0

I have an angularjs app which, on page load, lists entries from a remote server, within the app, it stores a value which i need to query the web service with.

Problem i am having is that when i create a service called "fetchSearchQueryParam" and do the following:

fetchSearchQueryParam.getParam() just before running the $http request, it is returning nothing. From debugging, it will pull the value after everything has loaded, which also means my controller.

How do i force it to run my database query on page load, store the value in $rootScope so i can use it in all calls to the server?

4

0 回答 0