How to specify a default state in AngularJS ui-router module -
I'm trying to get it: When the user enters the URL that matches any of the URL patterns The state of the states configured in If this is the case, then I set the state I found a solution of myself: it is possible to use the regular expression for the parameter URL " -Ool "status, as the previous state registered in If any other URL pattern does not match, this condition will be selected and the full path can be accessed via $ stateProvider should not be set to the default state, which is named for example
'notFound' . Entry into this situation should leave the URL untouched, so the user has an opportunity to fix it. This is the reason that I
$ urlRouterProvider.otherwise () . I'm not using . Currently I am working with the following solution: In my main controller, I check that
$ state.current.name == ''
'notFound' .
$ state.go ('notFound', {}, {location: wrong}); However, it seems a bit like a hack because I think it's a way of configuring all modules. Config (), but I do not know how. Any thoughts on this?
$ stateProvider :
$ stateProvider.state ('notFound', { Url: '{path:. *}', TemplateUrl: '/notFound.html'});
$ stateParams.path is.
Comments
Post a Comment