Loader button directive for Angularjs
Bower
bower install angularjs-loader-button --save
NPM
npm install angularjs-loader-button --save
Add angularjsLoaderButton
as dependency in your module.
angular.module('app',['angularjsLoaderButton']);
<loader-button text="Button text" load="fetchDatas()"></loader-button>
The loaderButton
directive will call the function passed in load
attribute. This function should be in $scope
and should return an Promise
instance. Likewise:
$scope.fetchDatas = function() {
return $http.get(...).then(..);
};
The live demo is comming...
Please let me know if you are having problems, create an issue. Thanks!