Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

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

Open
monkeymonk opened this issue Feb 20, 2015 · 3 comments
Open

Comments

@monkeymonk
Copy link

I have tried something like this but without success:

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

Any clue?

Thanks ! ;-)

@monkeymonk
Copy link
Author

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

@grbsk
Copy link
Owner

grbsk commented Feb 21, 2015

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.

@monkeymonk
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants