You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iknb/admin/directives/customOnChange.directive.js

16 lines
356 B

'use strict';
angular
.module('sloDialectsAdmin')
.directive('customOnChange', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
var onChangeHandler = scope.$eval(attrs.customOnChange);
element.on('change', onChangeHandler);
element.on('$destroy', function () {
element.off();
});
}
};
});