angularifyjs / angular-spinner

Spinner directive based on $http interceptor
http://angularify.org
MIT License
0 stars 0 forks source link

angular-spinner Build Status Coverage Status

Spinner directive based on $http interceptor

Usage

Installing

Download the Production version or the Development version.

Or download it with bower: open terminal and run

bower install bower-angular-spinner

Include js files into your web page:

<script type="text/javascript" src="https://github.com/angularifyjs/angular-spinner/raw/master/[...]/spinner[.min].js"></script>

Add dependency to your app module:

angular.module('your-app-name', [
  'angular-spinner'
]);

The spinner module is now installed. It exposes the SpinnerConfig factory and spinner directive into your app.

Using

Directive

<div spinner="">
  <img src="https://github.com/angularifyjs/angular-spinner/raw/master/images/wait_icon.gif" />
</div>
angular.module('app', [
  'angular-spinner'
]);

Event listener

angular.module('app', [
  'angular-spinner'

]).run(function(){
  $scope.$on(SpinnerConfig['_START_REQUEST_'], function() {
    // To-do
  });
  $scope.$on(SpinnerConfig['_END_REQUEST_'], function() {
    // To-do
  });

});

SpinnerConfig

SpinnerConfig.isSpinning

Type: boolean

Check spinning or not

SpinnerConfig.pendingRequests

Type: integer

Number of pending requests

Documentation

See Getting started

Release History

See CHANGELOG.md

Contributing

See CONTRIBUTING.md

License

MIT - Copyright (c) 2014 Angularfiy.org & HenryTao.