Angularjs 从指令监视提供程序中的数据

Angularjs 从指令监视提供程序中的数据,angularjs,directive,provider,Angularjs,Directive,Provider,我有一个监视变量并隐藏/显示加载指示器的指令: }.指令'loadingIndicator',['loadingIndicator',functionLoadingIndicator'{ //在编译期间运行 返回{ //姓名:, //优先事项:1, //终端:是的, //作用域:{},//{}=isolate,true=child,false/undefined=no change //控制器:函数$scope、$element、$attrs、$transclude{}, //require:

我有一个监视变量并隐藏/显示加载指示器的指令:

}.指令'loadingIndicator',['loadingIndicator',functionLoadingIndicator'{ //在编译期间运行 返回{ //姓名:, //优先事项:1, //终端:是的, //作用域:{},//{}=isolate,true=child,false/undefined=no change //控制器:函数$scope、$element、$attrs、$transclude{}, //require:'ngModel',//数组=多个requires,?=可选,^=检查父元素 限制:“A”, 模板:, //templateUrl:, //替换:正确, //是的, //编译:functiontElement,tAttrs,function transcludefunctionscope,cloneLinkingFn{返回函数linkingscope,elm,attrs{}, 链接:功能$scope、iElm、iAttrs、控制器{ $scope.display=LoadingIndicator.GetLoadingIndicator显示状态; iElm.CSS显示、LoadingIndicator.GetLoadingIndicator显示状态; iAttrs.src=/ico_branding/Loading.gif; $scope.$watch 作用{ 返回LoadingIndicator.GetLoadingIndicator显示状态 }, 作用{ iElm.CSS显示、LoadingIndicator.GetLoadingIndicator显示状态; } } }; }];
我认为您正在寻找类似HTTP加载程序的东西。老实说,我对我所做的很满意。我只是想知道为什么它不起作用