0

I am making a $http.get request in an app.run() block to set some $rootScope variables. The issue is that the code that uses those $rootScope variables is running before those variables are set because the call is asynchronous. It's also in a different js file.

It seems like I should use jquery to make the http call (I can make it synchronous using jquery), rather than trying to make a promise or defer object visible across the files.

Any ideas? Thanks.

mstrom
  • 1,655
  • 3
  • 26
  • 41
  • 1
    http://stackoverflow.com/questions/27050496/run-controllers-only-after-initialization-is-complete-in-angularjs Does it help? – Yauheni Leichanok Apr 08 '15 at 21:56
  • never use synchronous calls... they are being deprecated by browser vendors who are now throwing deprecation warnings in console if you use them – charlietfl Apr 08 '15 at 22:03

0 Answers0