-
Notifications
You must be signed in to change notification settings - Fork 3k
It would be nice to use transitionTo to define parameters that aren't necessarily in the url. #426
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
Comments
Don't know if that's particular to mobile but services are one generally accepted way to share lomger lasting data. |
Yes indeed, the thing is (I feel...) it's introducing "global longer lasting data" when what is needed is a "contextual short lasting data transit" between specific views. Is there anyway to make this work ? |
I believe that if you define your state as having a params property instead of a url you can do that. |
I will have to investigate this... I currently don't understand how I can substitute one for the other... Is there any example of this ? is this substitution technic the equivalent in it's features ? |
I think you can sort of see it here https://github.com/angular-ui/ui-router/blob/master/sample/states.js#L229. I'm on my tablet and can't type much. |
OK after investigation in the params option I sorry to inform you that i could not make it work...
$state.params and $stateParams are always empty objects. I read that there were some issue with it ( the object was converted to a string etc.. ) can someone give a status on this issue ? or create a jsfidle with a transitionTo passing a complex object to a state without url ? this is the version I am using @Version v0.0.2-dev-2013-08-19 |
Try putting params on the state not views. |
Ok this works thanks for the tip. The problem remains though, as the complex object is being converted to a string... |
I think you're throwing a lob?
You're passing a string... still not clear to me what this has to do with mobile, but I'll take your word for it :) |
I know this was a test, i then removed the single quotes, and bordereau becomes a reference to an entity object spawned by JayData... I am currently persisting states between views via service... as the values set in this service is long lasting you need to never forget to remove it once you are done with it. The thing is if it was attach to the stateParams you would not need to remove it as it's been destroy and garbage collected after use, plus the mechanism of transitionTo seems the right candidate to transit with additional data. So the issue of the conversion to a string of my entityObject remains... what is the rational for it ? |
I'm surprised. I thought the object was be preserved. |
Right now parameters are string-only. This will be fixed with the implementation of #454. Keep an eye out there. |
can we pass objects these days with transitionTo ? |
In the context of a mobile application the transtionTo method IMO feels like it's missing the ability to pass data from state to state. I understand that the concern for this missing feature is that the view would be loosing it's data on a reload of the url. As this concern is not necessarily applicable to all contexts, could we be provided with a way to communicate data from view to view via the ui-router without it being part of the url ?
The text was updated successfully, but these errors were encountered: