I have two routes : 1. login   2. others.

Everytime a route changes, I check if I am going to login or other route.
At this point I have to make an API call here to check if I am logged in or
not to handle route redirection based upon response.
Now in the config section where I am managing this, I need a URL for an
endpoint.
This endpoint is passed to a utility function that adds base path and API
version to form the complete URL*.*

Now this is something that I want to keep as a utility function. I kept it
in rootScope initially but then later decided to move it to a service but I
couldn't inject it here.

On Tue, Oct 7, 2014 at 12:47 PM, Sander Elias <sanderel...@gmail.com> wrote:

> Amogh,
>
> What is it you are trying to do in the configuration part, that needs all
> this stuff?
>
> You can indeed use a constant to provide utility functions if you want. I
> have done this a couple of times, but it isn't
> widely used.
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/1DvikuoanZM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> angular+unsubscr...@googlegroups.com.
> To post to this group, send email to angular@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to