Pre-built async-chainable NPM repo suitable for use within regular JavaScript or AngularJS on the frontend.
See the main async-chainable documentation for how to use the module. This is just the frontend version.
-
Install the component via Bower:
bower install angular-async-chainable
-
Include the following files in your HTML header:
<script src="/bower_components/angular-async-chainable/async-chainable.js"></script>
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();
-
Install the component via Bower:
bower install angular-async-chainable
-
Include the following files in your HTML header:
<script src="/bower_components/angular-async-chainable/async-chainable.js"></script> <script src="/bower_components/angular-async-chainable/angular-async-chainable.js"></script> -
Setup the component in your Angular app:
angular.module('app', ['angular-async-chainable']);
-
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(); });