Inspecting Angular 1.x UI Router

Updated . Posted . Visible to the public.

If your Angular app has some decent complexity, it will not be easy to use UI Router straight away. Here are some hints on how to get around.

Accessing the UI Router $state service from the browser console

$state = angular.element(document.body).injector().get('$state'): Retrieves the Angular injector and asks it for the $state service.

Inspecting the current state

$state.current

Inspecting params of the current state

$state.params

Dominik Schöler
Last edit
Dominik Schöler
Keywords
state, routes
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2017-10-26 09:16)