Skip to content

Default values for stateParam #1120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pdeva opened this issue Jun 3, 2014 · 3 comments
Closed

Default values for stateParam #1120

pdeva opened this issue Jun 3, 2014 · 3 comments

Comments

@pdeva
Copy link

pdeva commented Jun 3, 2014

while #436 proposed the same question a while back, it was closed with the context being a fix was in the works. However, while the said 'fix' is finished, there still isnt a way to provide default values to $stateParams.

The suggested method in that thread of using urlRouterProvider dont work when the url itself can contain stateparams and thus not be known in advance.

@IGx89
Copy link

IGx89 commented Dec 29, 2014

0.2.12 added the params property to the $stateProvider.state method (see http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$stateProvider), which allows default values for parameters to be specified. Does that solve your issue?

@mesllo
Copy link

mesllo commented Jan 11, 2017

It seems that once a param is changed, it has to be changed back even if the parameter is untouched on the next time it is redirected to.

@christopherthielen
Copy link
Contributor

@jablesauce you might be seeing the parameter inheriting behavior of { inherit: true }

both the ui-sref and $state.go() inherit by default.

https://ui-router.github.io/ng1/docs/latest/interfaces/transition.transitionoptions.html#inherit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants