File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 580
580
}
581
581
return false ;
582
582
} ;
583
+ if ( ! inputValue ) return resultMultiple ; //If ngModel was undefined
583
584
for ( var k = inputValue . length - 1 ; k >= 0 ; k -- ) {
584
585
if ( ! checkFnMultiple ( $select . selected , inputValue [ k ] ) ) {
585
586
checkFnMultiple ( data , inputValue [ k ] ) ;
Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ describe('ui-select tests', function() {
23
23
$timeout = _$timeout_ ;
24
24
scope . selection = { } ;
25
25
26
- //TESTME
27
- scope . selection . selectedMultiple = [ ] ;
28
-
29
26
scope . getGroupLabel = function ( person ) {
30
27
return person . age % 2 ? 'even' : 'odd' ;
31
28
} ;
@@ -755,6 +752,15 @@ describe('ui-select tests', function() {
755
752
expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 0 ) ;
756
753
} ) ;
757
754
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
+
758
764
it ( 'should render initial selected items' , function ( ) {
759
765
scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] ] ; //Wladimir & Samantha
760
766
var el = createUiSelectMultiple ( ) ;
You can’t perform that action at this time.
0 commit comments