File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,6 @@ uis.directive('uiSelect',
60
60
$select . onSelectCallback = $parse ( attrs . onSelect ) ;
61
61
$select . onRemoveCallback = $parse ( attrs . onRemove ) ;
62
62
63
- //Limit the number of selections allowed
64
- $select . limit = ( angular . isDefined ( attrs . limit ) ) ? parseInt ( attrs . limit , 10 ) : undefined ;
65
-
66
63
//Set reference to ngModel from uiSelectCtrl
67
64
$select . ngModel = ngModel ;
68
65
@@ -86,6 +83,11 @@ uis.directive('uiSelect',
86
83
var sortable = scope . $eval ( attrs . sortable ) ;
87
84
$select . sortable = sortable !== undefined ? sortable : uiSelectConfig . sortable ;
88
85
} ) ;
86
+
87
+ attrs . $observe ( 'limit' , function ( ) {
88
+ //Limit the number of selections allowed
89
+ $select . limit = ( angular . isDefined ( attrs . limit ) ) ? parseInt ( attrs . limit , 10 ) : undefined ;
90
+ } ) ;
89
91
90
92
scope . $watch ( 'removeSelected' , function ( ) {
91
93
var removeSelected = scope . $eval ( attrs . removeSelected ) ;
You can’t perform that action at this time.
0 commit comments