我的指令是
myApp.directive('myRequired', function ($compile, gettextCatalog) {
return {
link: function (scope, element, attrs) {
var noticeContainer = '<div class="inputError" ng-show="showSomeNotices" translate>{{errorMessage}}</div>';
element.after(noticeContainer);
scope.$on("submitstart", function (event, data) {
scope.showSomeNotices = false;
if (!element.val()) {
scope.errorMessage = gettextCatalog.getString("Empty field");
scope.showSomeNotices = true;
}
});
}};
});
但是ng-show和bracets会{{errorMessage}}
忽略连接的变量。我总是{{errorMessage}}
在页面上看到文字。怎么修?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句