Angular directive to show an animated spinner (using <a href="http://fgnass.github.io/spin.js/">spin.js</a>)
Angular directive to show an animated spinner (using spin.js)
Copyright (C) 2013, 2014, 2015, 2016, Uri Shaked email@example.com.
Get both spin.js and angular-spinner
$ npm install angular-spinnerfrom your console
$ bower install angular-spinnerfrom your console
Include both spin.js and angular-spinner.js in your application.
Add the module
angularSpinner as a dependency to your app module:
var myapp = angular;
You can now start using the us-spinner directive to display an animated spinner. For example :
You can also pass spinner options, for example:
Possible configuration options are described in the spin.js homepage.
You can direct the spinner to start and stop based on a scope expression, for example:
You can use
usSpinnerConfigProvider to configure default options for all spinners globally. Any options passed from a directive still override these.
Themes provide named default options for spinners. Any options passed from a directive still override these.
Start spinnerStop spinner
usSpinnerService service let you control spin start and stop :
Note that when you specify a key, the spinner is rendered inactive. You can still render the spinner as active with the spinner-start-active parameter :
spinner-start-active is ignored if spinner-on is specified.
The spinner-key will be used as an identifier (not unique) allowing you to have several spinners controlled by the same key :
... random html code ...<!-- This spinner will be triggered along with the first "spinner-1" -->
Released under the terms of MIT License.
grunt buildonce all tests are passing. Commit, push, PR.