1.0.1 • Published 8 years ago

angular-async-chainable v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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 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(); });