This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 580580 }
581581 return false ;
582582 } ;
583+ if ( ! inputValue ) return resultMultiple ; //If ngModel was undefined
583584 for ( var k = inputValue . length - 1 ; k >= 0 ; k -- ) {
584585 if ( ! checkFnMultiple ( $select . selected , inputValue [ k ] ) ) {
585586 checkFnMultiple ( data , inputValue [ k ] ) ;
Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ describe('ui-select tests', function() {
2323 $timeout = _$timeout_ ;
2424 scope . selection = { } ;
2525
26- //TESTME
27- scope . selection . selectedMultiple = [ ] ;
28-
2926 scope . getGroupLabel = function ( person ) {
3027 return person . age % 2 ? 'even' : 'odd' ;
3128 } ;
@@ -755,6 +752,15 @@ describe('ui-select tests', function() {
755752 expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 0 ) ;
756753 } ) ;
757754
755+ it ( 'should set model as an empty array if ngModel isnt defined' , function ( ) {
756+
757+ // scope.selection.selectedMultiple = [];
758+ var el = createUiSelectMultiple ( ) ;
759+
760+ expect ( scope . selection . selectedMultiple instanceof Array ) . toBe ( true ) ;
761+
762+ } ) ;
763+
758764 it ( 'should render initial selected items' , function ( ) {
759765 scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] ] ; //Wladimir & Samantha
760766 var el = createUiSelectMultiple ( ) ;
You can’t perform that action at this time.
0 commit comments