Different types of progressbuttons implemented on AngularJS
npm install angular-progress-button-stylesCheck out Live demo!
Basic usage
---------------
Install bower package:
``bash`
bower install --save angular-progress-button-styles`
Include scripts and styles (I use FontAwesome for success and error icons, but you can override it):html``
Add angular module dependency:javascript`
var app = angular.module('app', ['angular-progress-button-styles']);`
Add directive to the button element!html`
That's it! Enjoy the plugin!
Configuration
-------------
The directive itself takes as a parameter callback function, that returns promise after execution. If function returns value progress completes instantly.
You can configure plugin using two different ways:
* Using html attributes
* Using javascript
##### HTML configuration
Here is a list of supported HTML attributes and their meaning:
| Attribute | Available values | Meaning |
|---|---|---------|
| pb-style |
during the app configuration:
`javascript
mdl.config(function(progressButtonConfigProvider) {
progressButtonConfigProvider.profile('testProfile', {
style: 'shrink',
direction: 'vertical'
});
});
`
In this example new profile called 'testProfile' created. You can then apply it to you button like this:
`html
`
This would create new button with style _shrink_ and _vertical_ direction.You can as well define default profile, that will be applied to all the buttons across your application:
`javascript
progressButtonConfigProvider.profile({
style: 'shrink',
direction: 'vertical'
});
``License
-------------
MIT license.
Contribution
-------------
You are welcome to contribute. Feel free to contact me.
Special thanks for contribution:
* danielgranat
* Toby Summerfield