Friday, 19 August 2016

jquery - Angular JS - $http.get as part of app.run() that I need to be synchronous

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.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...