Is there a way to add a search parameter to the URL when using UI-Router's $state.go()
? I would like to use a defined state with additional info in the URL instead of defining a new route with the same configuration.
I have a simple view defined:
.when('page-with-form', {
template: 'views/page-with-form.html',
url: '/page-with-form'
})
I want the route to work as normal when someone navigates to /page-with-form
but when I have something else in the application that would redirect the user to that route with some additional information /page-with-form?error=true
something like this perhaps:
$state.go('page-with-form', '?error=true');
{}
, you can then get it later using$stateParams
. See docs github.com/angular-ui/ui-router/wiki/… – Chandermanipage-with-form/error/true
I wantpage-with-form?error=true
. Does that make sense. – kalisjoshua