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.

2
  • 1
    stackoverflow.com/questions/27050496/… Does it help? Commented Apr 8, 2015 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 Commented Apr 8, 2015 at 22:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.