angular_progress 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTMwZTUxMTc0MjE4NDZmNTRjMTJhYzQ4MzY4YjAxNGE5ODc1ZWUxZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWNmZTA1NWQ1ZjU2YTNjMTI0YTFjMmE2Nzk2ZTg4ZmI1ZmM5ZTlmNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGQ5ZTIwYmZhMDU1YTdhZjAyNjU5NGM3MmE5YTBmM2U3N2I0ZWI2NjI3MWE0
|
10
|
+
YWM2ZGE2MDQ4MmQyNTU0OTI0MzkxZDQ0ZDJiNzk1MjllN2RjZjBkZWM5Zjc0
|
11
|
+
NzM1NzNlMjEyNmQ4YTI1YWE1ODQxNjdiZmNmMTg5NGFlZTZjYTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTdjOTM4NmE3NTUwYTFlNWVkNTc5MGE1MmNhY2JhZDVmMzRmYmM4OWU2YzZj
|
14
|
+
Y2UzMTNmYjEyYWQ3ODgzYmZkOTAyOGY2ODI0ZjkwMDUwNDY3ZTQ2OTZhZTZk
|
15
|
+
NmM1MTBmM2JlODMyNGI4NDNiZGEwMTg0NTY4ZDIyZGJhMTgxZjc=
|
data/README.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# AngularProgress
|
2
2
|
|
3
|
-
|
3
|
+
Display progress of an HTTP action using AngularJS. Use it for spinners, progress-messages, success messages.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
+
There are two ways to use AngularProgress
|
8
|
+
|
9
|
+
#### Javascript
|
10
|
+
|
11
|
+
|
12
|
+
#### Ruby gem
|
13
|
+
|
7
14
|
Add this line to your application's Gemfile:
|
8
15
|
|
9
16
|
gem 'angular_progress'
|
@@ -18,8 +25,37 @@ Or install it yourself as:
|
|
18
25
|
|
19
26
|
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
Example: Button with pending & success message ![button](https://dl.dropboxusercontent.com/u/23457337/angular_progress_1.gif)
|
29
|
+
|
30
|
+
Example: Button with pending & error message ![button_with_error](https://dl.dropboxusercontent.com/u/23457337/angular_progress_with_error.gif)
|
31
|
+
#### Markup
|
32
|
+
|
33
|
+
<div ng-controller="TestController">
|
34
|
+
<a ng-angular-progress="sampleHttpRequest" class="btn btn-default" ng-click="startRequest()"
|
35
|
+
http-pending="Saving..."
|
36
|
+
http-success="Saved Successfully"
|
37
|
+
http-error="Uh oh...">
|
38
|
+
Save
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
#### Javascript
|
43
|
+
```javascript
|
44
|
+
|
45
|
+
angular.module('SampleApp', ['AngularProgress']);
|
22
46
|
|
47
|
+
angular.module('SampleApp').controller('SampleController', [
|
48
|
+
'$http', '$scope', function($http, $scope) {
|
49
|
+
$scope.makeRequest = function() {
|
50
|
+
$http.post('/my/endpoint', {
|
51
|
+
param1: 'value1'
|
52
|
+
}, {
|
53
|
+
requestName: 'sampleHttpRequest'
|
54
|
+
});
|
55
|
+
};
|
56
|
+
}
|
57
|
+
]);
|
58
|
+
```
|
23
59
|
## Contributing
|
24
60
|
|
25
61
|
1. Fork it
|
data/vendor/assets/javascripts/angular_progress/interceptors/http_progress_interceptor.js.coffee
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
angular.module('
|
1
|
+
angular.module('AngularProgress').factory 'httpProgressInterceptor', ['$q', '$rootScope', ($q, $rootScope) ->
|
2
2
|
request: (request) ->
|
3
3
|
requestName = request.requestName || request.config?.requestName || request.data?.requestName
|
4
4
|
if requestName
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular_progress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tushar Ranka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|