angularjs - fixing loader ajax to show only for router -


A sub page is loading inside the ng-view, so I want to show an AJAX indicator. I just want to show it to the router but the code snippet below is showing the AJAX indicator for all AJAX requests, how to fix it?

  directive ('loading', ['$ http', function ($ Http)) {return {restrict: 'a', link: function (scope, elm, ethers) {debugger; Scope.Iso loading = function () {debugger; return $ http.pendingRequests.length & gt; 0;} area $ watch (scope.is loading, function (v) {debugger; if (v) {elm.show ( );} else {elm.hide ();}}}}}}}}]);   

Usage

  & lt; div class = "ajax-ngview" data loading & gt; & Lt; / Div & gt; & Lt; Div ng-view & gt; & Lt; / Div & gt;   

I'm seeing something like this

  $ routeProvider. When this URL is being loaded ('/', {templateUrl: '/ MCT / home / home', / /} a special AJAX activity GIF controller: function ($ scope) {$ scope.setActiveMenuMod ('mct-mod ');}})    

$ httpProvider.interceptors.push (function ($ q, dependency 1, dependency 2) {return {'request': function ( Config) {// trigger data loading}, 'response': function (response) {// same as is}};

});

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -