apollo_developers/assets/js/directives/dismiss.js
venbatechnologies@gmail.com 1809bcf9c9 fixed table for student details
2018-04-23 18:34:11 +05:30

17 lines
455 B
JavaScript
Executable File

'use strict';
/**
* A directive used for "close buttons" (eg: alert box).
* It hides its parent node that has the class with the name of its value.
*/
app.directive('ctDismiss', function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
elem.on('click', function (e) {
elem.parent('.' + attrs.ctDismiss).hide();
e.preventDefault();
});
}
};
});