16 lines
356 B
JavaScript
16 lines
356 B
JavaScript
'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();
|
|
});
|
|
}
|
|
};
|
|
}); |