-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow params to be a callback #2615
Comments
Is this when you are defining the states? |
I want to clarify this: you are defining default values for parameters in code such as this:
Is that what you want to do? If no parameter value is provided (either from ui-sref or deep link) then the default value is computed (your functions are called) and used. I'm not sure if that's your assumption or not based on this comment:
Or, you could reduce your state definition boilerplate like so:
Or go even deeper:
|
closing due to inactivity |
We have a filter that sets selected params to the local storage with cookie fallback. I could not find a better way to inject the params as shown below.
I could encapsulate the whole repetetive logic here into a method that would build the params based on the filter settings we have for each filter type. But the router won't let me do that. :( I can define a callback for every param but I can't do
params: function() { ... }
.Is there a better way of doing what I try to do or can we get that feature added to the router? We're currently using 0.2.*.
Overall I had a lot of trouble getting the query params to persist, even between two route changes... I've also had to deal with this issue #2603 and this here #2608 was (well, still is) a huge pain in the rear.
The text was updated successfully, but these errors were encountered: