You just named it. Call services from controllers, make your services
return promises (e.g. returning $http.get... or $http.get...then... or your
own promises) and act upon results in controllers, using $location or
what-else responsible for navigation.

Regards,
Witold Szczerba
---
Sent from my mobile phone.
On Mar 3, 2014 7:11 PM, "Louis-Philippe Laurin" <[email protected]> wrote:

> Hi,
>
> I am new to AngularJS and wondering what is the best pattern for
> conditional navigation based on a service call result.
>
> When receiving a web request response at my service level. What is the
> best pattern to navigate to the right page in my app? The location and
> navigation services can be accessed from anywhere due to Angular but I
> would like to keep my separation of concerns and leave the navigation into
> the controller and my business logic in my service. Is there a right way to
> do it?
>
> Thanks in advance,
> LP
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to