AngularJS - передать функцию в директиву
У меня есть пример angularJS
angular.module('dr', [])
.controller("testCtrl", function($scope) {
$scope.color1 = "color";
$scope.updateFn = function() {
alert('123');
}
})
.directive('test', function() {
return {
restrict: 'E',
scope: {color1: '=',
updateFn: '&'},
template: "Click",
replace: true,
link: function(scope, elm, attrs) {
}
}
});
Я хочу, чтобы при нажатии кнопки появлялось окно с предупреждением, но ничего не показывалось.
Может кто-нибудь мне помочь?