ng-busy
ng-busy copied to clipboard
How to start busy when regular http post or simple button click ?
I have tried something like this but without success:
window.onbeforeunload = function () {
$scope.$broadcast('busy.begin', {remaining: 0});
};
Any clue?
Thanks ! ;-)
Ok... I juste have to use $rootScope instead of $scope ...which is obvious in fact. ʕ•ᴥ•ʔ
Yeah, there isn't currently a way to manually trigger it. I could add an optional binding where it could evaluate the expression to true or false, and toggle busy accordingly.
Yep I think that could be nice ! In some case, I try to let the form be submitted as usual, not via AJAX.
For now I simply use a ng-click that run $rootScope.$broadcast('busy.begin', {remaining: 0});... but it will be very clean with a simple trigger on click or on value changing.