我有一个像下面这样的指令,基本上是用当前元素附加一个新元素。并在新元素中绑定 ng-controller "openCntl"
explorerModule.controller("openCntl",function($scope, $dialog){
$scope.open = function(){
alert('dialog closed with result: ' + result);
};
});
explorerModule.directive('ngCustomerClick', function($parse){
return {
controller : "openCntl",
link: function(scope, element, attr){
var alert = angular.element(
'<div class="lp-dropdown-wrapper open" ng-controller="dialogCntl" ' +
'><div class="arrow"></div>' +
'<ul class="nav nav-tabs" style="display: inline;">' +
'<li class="add" ng-click="open()"><a tabindex="-1" href="#"><span class="icon-coffee"></span>Add</a></li>'+
'</ul></div>'
);
}
}
});
但是当我单击li时,不要调用控制器“openCntl”中的函数,如何实现?
多谢