How to get Angularjs UI Router list of states? -
How to get Angularjs UI Router list of states? -
is there way list of states configured application through angularjs ui router? i.e after configuring states (aka routes in angular), how array of these states or state objects.
in other words, equivalent of angular's built in router's "$route.routes
" in angular ui router?
tried find in ui router's api documentation, can't find it.
use $state.get()
.
following in controller
app.controller('mainctrl', function ($state) { console.log(angular.tojson($state.get())); });
would spit out like
[{ "name":"", "url":"^", "views":null, "abstract":true },{ "name":"main", "url":"/main", "controller":"mainctrl", "templateurl":"main.html" }]
angularjs angular-ui-router
Comments
Post a Comment