Open ghost opened 9 years ago
No, you don't need to do anything special. That behaviour is correct even if it's not what you're expecting. Because it's the same "route", and only the data is changing, Template.start is never removed and replaced with something else, which is what we use as the basis for transitions.
I think you could maybe do another RenderController inside of the start template, like:
{{#RenderController}}
{{#with this}}
{{>innerStartTemplate}}
{{/with}}
{{/RenderController}}
that's just a guess but I think that should force the template to be removed and reinserted every time the data changes. If not, set up a repro on meteorpad and I'll play around a bit.
Note, to avoid unnecessary transitioning if the the document with that id changes, vs the document id changing, you'd have to do something about more finegrained.
I use meteorpad for the first time. Can u also edit it ?
Omg, this is actually super hard... Meteor is too clever :> I got the transition working with a very hacky approach, but the problem is that you see the page update while it's transition out. We could turn off reactivity for that, but then you'll lose reactivity if the data updates on the same item. I guess I'm going to have to come up with something smart for cases like this, which disables reactivity when the transition starts. We'll have to leave this open for now.
Anyways, thanks for sending the code on meteorpad, makes things a lot easier. And yeah, I can fork, here's where I got to: http://meteorpad.com/pad/2KM6sistAyHwY6wab/Copy%20of%20RenderContollr
Thanks.. I think it is the easiest approach i tried and it is just ok for my use for now )))
I am going to look.. https://github.com/PEM--/MeetupFamousSlides/blob/master/lib/routing.coffee
Yeah, that's much easier, because each slide is a different template.
I have
main.hmtl
and
router.js
RenderController render pages normally with transitions when I go from different template names. Ex: from "About page" to "Home page" . But when I go from "started/1" to "started/2". No transitions.
Do I need something Router specific or destroy some famous stuff and recreate with something onBeforeAction?