Parameters

rule: string | function

:

The url path you want to redirect to or a function rule that returns the url path or performs a $state.go().
The function version is passed two params: $injector and $location services, and should return a url string.