I am developing an angular js application, and i need to run a function, via service provider, before everything else. The function is a get request, which returns two variables in JSON, which returns either `true` or`false`.
If the variable is true, then load another state (i am using ui router). How can i do that?