동일한보기에서 지시문을 두 번 호출하려고합니다. 내가 페이지를로드 할 때 다음과 같은 오류가 있습니다같은보기에있는 여러 개의 지시문이 작동하지 않습니다/Angularjs
ionic.bundle.js:21162Error: [$compile:multidir] Multiple directives [translate (module: pascalprecht.translate),mwConfirmClick] asking for new/isolated scope on:
내 지시어 :
app.directive("mwConfirmClick", [
function() {
return {
priority: -1,
restrict: 'A',
scope: { confirmFunction: "&mwConfirmClick" },
link: function(scope, element, attrs){
element.bind('click', function(e){
// message defaults to "Are you sure?"
var message = attrs.mwConfirmClickMessage ? attrs.mwConfirmClickMessage : "Are you sure?";
// confirm() requires jQuery
if(confirm(message)) {
scope.confirmFunction();
}
});
}
}
}
]);
당신이 내 지시를 설정하시기 바랍니다 도움이 있을까요? 같은 관점에서하지만 같은 요소뿐 아니라 분리 범위 (scope: {...}
) 두 지시어를 사용하고 같은 사전