Skip to content

Commit 994a5e4

Browse files
committed
Update README.md
1 parent 86aae1a commit 994a5e4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,25 @@ Example: `var myTracker = promiseTracker({ activationDelay: 500, minDuration: 75
147147
//Add $http promise to both 'tracker1' and 'tracker2'
148148
$http.post('/elephant', {some: 'data'}, { tracker: [myFirstTracker, mySecondTracker] })
149149
```
150+
151+
## More Examples
152+
153+
* Do something whenever the tracker's active state changes
154+
155+
```js
156+
angular.module('app', ['ajoslin.promise-tracker'])
157+
158+
.factory('myTracker', function (promiseTracker) {
159+
return promiseTracker();
160+
})
161+
162+
.controller('AppCtrl', function ($rootScope, myTracker) {
163+
$rootScope.$watch(myTracker.active, function (isActive) {
164+
//doSomething()
165+
});
166+
});
167+
```
168+
;
150169

151170
## Development
152171

0 commit comments

Comments
 (0)