amp-async-function
v1.0.1
Published
Angular async function executor ES5 friendly
Downloads
5
Maintainers
Readme
amp-async-function
Angular async function executor ES5 friendly.
Demo
Check out here.
Usage
Install amp-async-function using npm.
npm install amp-async-function --save
Include module amp-async-function into your app.
angular.module("my.app", ["amp-async-function"]);
Guide:
- Inject the factory:
asyncFunction
; - Call your function:
asyncFunction.execute(yourFunction, [] /*array of params*/, 0 /*delay*/);
Use the factory as example below:
angular
.module("async-func-demo")
.controller("AsyncFuncController", AsyncFuncController);
function AsyncFuncController(asyncFunction) {
var vm = this;
vm.exec = function () {
asyncFunction.execute(vm.asyncFunc, [1], 10)
.then(function (data) {
// function resolved
});
}
vm.asyncFunc = function (id) {
return id;
}
}
Support on Beerpay
Hey dude! Help me out for a couple of :beers:!