Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit cae2307

Browse files
author
Ray Logel
committed
Observe the allowClear attribute so the flag can be set dynamically.
1 parent d524e80 commit cae2307

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/uiSelectMatchDirective.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ uis.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {
1616
$select.placeholder = placeholder !== undefined ? placeholder : uiSelectConfig.placeholder;
1717
});
1818

19-
$select.allowClear = (angular.isDefined(attrs.allowClear)) ? (attrs.allowClear === '') ? true : (attrs.allowClear.toLowerCase() === 'true') : false;
19+
function setAllowClear(allow)
20+
{
21+
$select.allowClear = (angular.isDefined(allow)) ? (allow === '') ? true : (allow.toLowerCase() === 'true') : false;
22+
}
23+
24+
attrs.$observe('allowClear', setAllowClear);
25+
setAllowClear(attrs.allowClear);
2026

2127
if($select.multiple){
2228
$select.sizeSearchInput();

0 commit comments

Comments
 (0)