This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
AriaNg/src/scripts/directives/indeterminate.js
2018-08-14 01:10:45 +08:00

18 lines
514 B
JavaScript

(function () {
'use strict';
angular.module('ariaNg').directive('ngIndeterminate', function () {
return {
restrict: 'A',
scope: {
indeterminate: '=ngIndeterminate'
},
link: function (scope, element) {
scope.$watch('indeterminate', function () {
element[0].indeterminate = (scope.indeterminate === 'true' || scope.indeterminate === true);
});
}
};
});
}());