Sander is saying that if you're using ngRoute or ui-router you can define 
"resolves" for your routes. You basically give a route a set of functions 
that return promises and they all have to be resolved before the route will 
load. You can then inject the resolved values of those promises into your 
controllers as locals.

There's documentation for each here:

https://github.com/angular-ui/ui-router/wiki#resolve
https://docs.angularjs.org/api/ngRoute/provider/$routeProvider

On Friday, July 10, 2015 at 3:46:54 AM UTC-5, Lijin AR wrote:
>
> First of all thank you for you suggestion, let me clarify things.
>
> As per you suggestion I think I can route my app to some other screen and 
> then load the data then I can re-route to my old screen, am I correct?
>
> On Friday, July 10, 2015 at 11:41:22 AM UTC+5:30, Sander Elias wrote:
>>
>> Hi Lijin,
>>
>> Don't replace them with watches. Performance will suffer even more. Put 
>> your $http calls into a services, and use a router to resolve them on 
>> invocation.
>> Or at least, wrap the actionable part of your controller inside a promise.
>>
>> Regards
>> Sander
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to