Javascript 删除指令表单HTML AngularJS
是否可以从另一个指令中删除direciveJavascript 删除指令表单HTML AngularJS,javascript,angularjs,Javascript,Angularjs,是否可以从另一个指令中删除direciveng-clope? 我有这样的指示: .directive('loading', loading); function loading($http) { var loadingSniper = { link: link, restrict: "AE" }; return loadingSniper; function link(scope, elm, attrs)
ng-clope
?
我有这样的指示:
.directive('loading', loading);
function loading($http) {
var loadingSniper = {
link: link,
restrict: "AE"
};
return loadingSniper;
function link(scope, elm, attrs)
{
scope.$watch('isLoading', function(){
//I NEED TO REMOVE NG-CLOAK FROM HERE
});
}
}
以下是HTML:
<div class="splash" ng-cloak="">
<h2>Loading</h2>
</div>
<div ng-cloak="">
</div>
加载
我在想要移除ng斗篷的地方添加了评论。。。。有什么想法吗 如果您只需要显示/隐藏,您可以。。。ng-Clope在AngularJS上有特殊用途,但是,如果您需要在之前展示一些东西,您可以使用elm。removeAttr(“ng-Clope”)问题是
ng-Clope
不在应用程序模块下…没有意义…如果它不在应用程序中,为什么它会在那里?ng应用程序在哪里?请显示所有相关代码,但如果未在应用程序模块下显示,则不会编译您的指令。。。如果需要,可以使用jQuery$(“[ng-斗篷”).removeAttr('ng-斗篷');