ng-busy icon indicating copy to clipboard operation
ng-busy copied to clipboard

How to start busy when regular http post or simple button click ?

Open monkeymonk opened this issue 10 years ago • 3 comments

I have tried something like this but without success:

window.onbeforeunload = function () {
    $scope.$broadcast('busy.begin', {remaining: 0});
};

Any clue?

Thanks ! ;-)

monkeymonk avatar Feb 20 '15 15:02 monkeymonk

Ok... I juste have to use $rootScope instead of $scope ...which is obvious in fact. ʕ•ᴥ•ʔ

monkeymonk avatar Feb 20 '15 15:02 monkeymonk

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.

grbsk avatar Feb 21 '15 00:02 grbsk

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.

monkeymonk avatar Feb 21 '15 00:02 monkeymonk