app/package/js/angular-http-loader.js
function (event, method) {
            if (methods.indexOf(method.toUpperCase()) !== -1) {
              showLoader = (event.name === 'loaderShow');
            } else if (methods.length === 0) {
              showLoader = (event.name === 'loaderShow');
            }

            if (ttl <= 0 || (!timeoutId && !showLoader)) {
              $scope.showLoader = showLoader;
              return;
            }
            if (timeoutId) {
              return;
            }

            $scope.showLoader = showLoader;
            timeoutId = $timeout(function () {
              if (!showLoader) {
                $scope.showLoader = showLoader;
              }
              timeoutId = undefined;
            }, ttl);
          }
function (event, method) {
            if (methods.indexOf(method.toUpperCase()) !== -1) {
              showLoader = (event.name === 'loaderShow');
            } else if (methods.length === 0) {
              showLoader = (event.name === 'loaderShow');
            }

            if (ttl <= 0 || (!timeoutId && !showLoader)) {
              $scope.showLoader = showLoader;
              return;
            }
            if (timeoutId) {
              return;
            }

            $scope.showLoader = showLoader;
            timeoutId = $timeout(function () {
              if (!showLoader) {
                $scope.showLoader = showLoader;
              }
              timeoutId = undefined;
            }, ttl);
          }
function ( event , method ) { if ( methods . indexOf ( method . toUpperCase ( ) ) !== - 1 ) { showLoader = ( event . name === 'loaderShow' ) ; } else if ( methods . length === 0 ) { showLoader = ( event . name === 'loaderShow' ) ; } if ( ttl <= 0 || ( ! timeoutId && ! showLoader ) ) { $scope . showLoader = showLoader ; return ; } if ( timeoutId ) { return ; } $scope . showLoader = showLoader ; timeoutId = $timeout ( function ( ) { if ( ! showLoader ) { $scope . showLoader = showLoader ; } timeoutId = undefined ; } , ttl ) ; }
Toggle the show loader.
Contains the logic to show or hide the loader depending
on the passed method

@param {object} event
@param {string} method
Toggle the show loader . Contains the logic to show or hide the loader depending on the passed method