UIKitのモーダルの閉じるときにイベントを差し込みたい。
UIKit:http://getuikit.com/docs/modal.html
$('.modalSelector').on({
'show.uk.modal': function(){
console.log("Modal is visible.");
},
'hide.uk.modal': function(){
console.log("Element is not visible.");
}
});
こうじゃなくてJqueryを使わないでやりたい
AngularJSのDirective
angular.module('docsSimpleDirective', [])
.controller('Controller', ['$scope', function($scope) {
$scope.test = function(){
console.log("test");
}
}])
.directive('myDomDirective', function () {
return {
scope: {
test: "&"
},
link: function ($scope, element, attrs) {
element.bind('hide.uk.modal', function () {
$scope.test();
});
}
};
});