As far as what can be injected into a resolver, it’s anything you’d be able to inject into something like a controller and previous resolved values. The second example shows how you would inject the first value.
The valueOne key name is also what gets injected into the controller.
location: If true will update the url in the location bar, if false will not. If string, must be “replace”, which will update url and also replace last history record.
inherit: If true will inherit url parameters from current url.
relative: When transitioning with relative path (e.g ‘^’), defines which state to be relative from. The $stateObject can be recovered with $state.get.
notify: If true will broadcast $stateChangeStart and $stateChangeSuccess events.
reload: If true will force transition even if no state or params have changed. It will reload the resolves and views of the current state and parent states. If reload is a string (or state object), the state object is fetched (by name, or object reference); and \ the transition reloads the resolves and views for that matched state, and all its children states.
The types and values of the options are shown below in the usage.
There are four very common events. All of them are hooked up on the $rootScope. Those events are:
$stateChangeStart: Fired when the state transition begins. You can use event.preventDefault() to prevent the transition from happening and then the transition promise will be rejected with a ‘transition prevented’ value.
$stateChangeSuccess: Fired once the state transition is complete.
$stateNotFound: Fired when a requested state cannot be found using the provided state name during transition. The event is broadcast allowing any handlers a single chance to deal with the error (usually by lazy-loading the unfound state). A special unfoundState object is passed to the listener handler, you can see its three properties in the example. You can use event.preventDefault() to abort the transition and the promise returned from go will be rejected with a ‘transition aborted’ value.