I'm writing a single-page application in AngularJS that needs to know, whether user is logged-in before running any routes at all.
I'm using Django backend, which supports anonymous sessions, so just looking at cookies I can't figure, if user is logged-in or anonymous. So, to find that out I want to make an Ajax request to backend in Angular application-global .run()
and delay any execution of angular application until that request finishes.
How do I do that?