I have been using Ember’s Router (v1.0.pre) with single dynamic segments and really happy with it.
So much magic.
However, I’m struggeling with multiple dynamic segments:
- What should
serialize()/deserialize()return? - How should the
transitionTo()call and the contex there look like?
Can somebody shed some light onto this?
serializeanddeserializeshould only be implemented when your context object has custom serialization (i.e is not an ember-data model instance). So you should not have to implement these methods while using the full ember stack.transitionToshould be called from routes event handlers, and the context is passed as follow:Given the
showPostevent has been trigged byactionhelper like that:More complex transitions can be achieved passing several context objects (for deeply nested routes):
post&commentcontexts will be passed to appropriated routes while routing will descend into nested routes.EDIT
Without ember-data, it would look like:
And you would have two classes
App.Post&App.Comment, withfindclass methods, andidinstances property.