• Stars
    star
    216
  • Rank 176,611 (Top 4 %)
  • Language
    CSS
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AngularJS version of codrops progress buttons for the use with promises

angular-progress-button-styles

AngularJS version of Codrops progress buttons. I've also made less and sass versions of it besides css.

Check out Live demo!

Basic usage

Install bower package:

bower install --save angular-progress-button-styles

Include scripts and styles (I use FontAwesome for success and error icons, but you can override it):

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="bower_components/angular-progress-button-styles/dist/angular-progress-button-styles.min.css">
<script type="text/javascript" src="bower_components/angular-progress-button-styles/dist/angular-progress-button-styles.min.js"></script>

Add angular module dependency:

var app = angular.module('app', ['angular-progress-button-styles']);

Add directive to the button element!

<button progress-button="someFunctionThatReturnsPromise()">Submit</button>

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
  • fill
  • shrink
  • rotate-angle-bottom
  • rotate-angle-top
  • rotate-angle-left
  • rotate-angle-right
  • rotate-side-down
  • rotate-side-up
  • rotate-side-left
  • rotate-side-right
  • rotate-back
  • slide-down
  • top-line
  • move-up
  • lateral-lines
  • flip-open
Defines button appearance. Default value is fill.
pb-direction
  • horizontal
  • vertical
To be used with pb-style=(fill or shrink). Defines the direction of the progress bar.
Default value is horizontal.
pb-random-progress
  • true
  • false
Runs random fill function from the moment button is clicked till promise is resolved.
Default value is true.
pb-profile String value The profile from which to fetch configuration during the button initialization.
For more information look JS configuration section
Javascript configuration

For those ones, who don't like to have a lot of configuration in HTML as well to prevent the copy-paste there also is possibility to define configuration in Javascript using profiles. To do this, you need to inject progressButtonConfigProvider during the app configuration:

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:

<button progress-button="someFunctionThatReturnsPromise()" pb-profile="testProfile">Submit</button>

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:

progressButtonConfigProvider.profile({
  style: 'shrink',
  direction: 'vertical'
});

License

MIT license.

Contribution

You are welcome to contribute. Feel free to contact me.

Special thanks for contribution:

More Repositories

1

ngx-admin

Customizable admin dashboard template based on Angular 10+
TypeScript
24,955
star
2

blur-admin

AngularJS Bootstrap Admin Panel Framework
JavaScript
11,355
star
3

react-native-ui-kitten

πŸ’₯ React Native UI Library based on Eva Design System 🌚✨Dark Mode
TypeScript
10,075
star
4

eva-icons

A pack of more than 480 beautifully crafted Open Source icons. SVG, Sketch, Web Font and Animations support.
TypeScript
8,560
star
5

nebular

πŸ’₯ Customizable Angular UI Library based on Eva Design System 🌚✨Dark Mode
TypeScript
7,986
star
6

kittenTricks

React Native starter kit with over 40 screens and modern Light and Dark theme for creating stunning cross-platform mobile applications.
TypeScript
7,078
star
7

ng2-smart-table

Angular Smart Data Table component
TypeScript
1,624
star
8

react-native-reddit-reader

react native
JavaScript
359
star
9

polymer-admin

Polymer admin dashboard
HTML
296
star
10

react-native-ui-kitten-demo-app

React Native UI-Kitten demo app
JavaScript
211
star
11

react-native-eva-icons

⭐Eva Icons for React Native
TypeScript
202
star
12

ngx-admin-dotnet-starter

TypeScript
179
star
13

chernika-mobile

Tinder-like app in Ionic framework
JavaScript
150
star
14

ngx-admin-bundle-support

Support repository for ngx-admin backend bundles with issues tracking, instructions and code samples
TypeScript
58
star
15

digitsquare

Angular and Cordova / Phonegap powered hybrid mobile application (puzzle game)
C#
44
star
16

chernika-server

Node.js backend for chernika-mobile
JavaScript
33
star
17

akveo-react-native-boilerplate

JavaScript
27
star
18

nebular-seed

Angular + Nebular ❀️ seed project
TypeScript
19
star
19

doc-prsr

Simple parser to normalize typdoc and doc.js output
TypeScript
14
star
20

meetup-samples

TypeScript
13
star
21

cordova-vk

cordova/phonegap adapter for vksdk
Java
8
star
22

nebular-todo

Nebular TODO application showcase
TypeScript
6
star
23

styleguide

JavaScript
5
star
24

akveo-banner

TypeScript
4
star
25

akveo.github.io

HTML
4
star
26

nebular-icons

Nebular icons (deprecated - use Eva Icons instead - https://akveo.github.io/eva-icons/)
CSS
3
star
27

dotnet-starter-bundle

1
star