https://github.com/hash-bang/angular-async-chainable
Pre-built async-chainable NPM repo suitable for use within regular JavaScript or AngularJS on the frontend
https://github.com/hash-bang/angular-async-chainable
angular async-chainable javascript
Last synced: 3 months ago
JSON representation
Pre-built async-chainable NPM repo suitable for use within regular JavaScript or AngularJS on the frontend
- Host: GitHub
- URL: https://github.com/hash-bang/angular-async-chainable
- Owner: hash-bang
- License: mit
- Created: 2015-08-18T05:41:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-12T03:41:33.000Z (about 9 years ago)
- Last Synced: 2025-02-01T18:04:37.402Z (4 months ago)
- Topics: angular, async-chainable, javascript
- Language: JavaScript
- Size: 139 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
angular-async-chainable
=======================
Pre-built async-chainable NPM repo suitable for use within regular JavaScript or AngularJS on the frontend.See the main [async-chainable](https://github.com/hash-bang/async-chainable) documentation for how to use the module. This is just the frontend version.
Plain JavaScript usage
----------------------
1. Install the component via Bower:bower install angular-async-chainable
2. Include the following files in your HTML header:
You can now use in your regular JavaScript code via the gloabl `asyncChainable()` function:
asyncChainable()
.then(function(next) {
console.log('Hello');
next();
})
.then(function(next) {
console.log('World');
next();
})
.end();Use within AngularJS
--------------------
1. Install the component via Bower:bower install angular-async-chainable
2. Include the following files in your HTML header:
3. Setup the component in your Angular app:
angular.module('app', ['angular-async-chainable']);
4. Require the `$async` service in any controller / component to use:
app.controller('myController', $async) {
asyncChainable()
.then(function(next) {
console.log('Hello');
next();
})
.then(function(next) {
console.log('World');
next();
})
.end();
});