我这里只有1个指令用于此元素,但我仍然遇到此错误。在网络上工作正常,但在使用phonegap时,我收到此错误。
<div class="card" ng-repeat="appointment in appointments track by appointment._id" ng-class="{confirmed: appointment.status === 'confirmed', notconfirmed: (appointment.status === 'not confirmed')}">
<a class="btn btn-danger btn-flat btn-flat-danger" action-confirm="$parent.cancelAppt(appointment)" text="Are you sure you want to cancel the appointment?" action-id="{{appointment._id}}">
</div>
(function(){
'use strict';
/**
* @ngInject
*/
function actionConfirm() {
return {
restrict: 'A',
scope: {
'text': '@',
'confirmed': '&actionConfirm',
'actionId': '@'
},
transclude: true,
templateUrl: 'common_loggedin/directives/views/action-confirm.html',
link: function (scope, element, attrs) {
element.bind('click', function() {
$('#'+ scope.actionId + '.actionConfirmModal').modal('show');
});
scope.confirm = function(){
scope.confirmed();
scope.close();
}
scope.close = function(){
$('#'+ scope.actionId + '.actionConfirmModal').modal('hide');
}
}
};
}
angular
.module('xyz')
.directive('actionConfirm', actionConfirm);
}());
错误:[$ compile:multidir]多个指令[actionConfirm,actionConfirm]要求进行翻译: