-
Notifications
You must be signed in to change notification settings - Fork 199
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
liquid fire within routes (on model change) trouble #593
Comments
Thanks for reporting, we clearly have some missing docs here. Model transitions on the same route are slightly annoying due to the fact that Ember controllers are singletons. So when a model changes, there is nothing to stop the template from immediately changing, so we have no way of gracefully showing the old content going away. But there are two solutions to your problem. The first (and most robust), is to use liquid-bind on your model as you would any changing value that you want to animate. {{#liquid-bind model use=someAnimation as |currentModel|}}
{{currentModel.title}}
{{/liquid-bind}} That gives us full control over when the content renders. We don't have control over when The second answer is that there is an experimental feature to animate model-to-model transitions directly within liquid-outlet, but it has a caveat (which is why it is still experimental and not the default behavior). To use it, you set {{#illiquid-model model as |currentModel}}
{{currentModel.title}}
{{/illiquid-model}} This again gives us control over when the content updates visually. The benefit is that you can write rules using |
Thanks for the explanation and suggestions. I tried the experimental feature by adding this to my application.hbs:
and this to my product.hbs (the 'product' route being one I want customers be able to "transition" from one product to another)...
But it looks like when I go from one product to the next, the previous model is being retained: Did I miss a step? Thanks again! |
Sorry if this is covered before...I did some searching and there was no answer forthcoming...
I am trying to figure out a pattern for applying liquid fire within the same route (like when the model changes but you stay on the same route), and not finding anything. I've tried alot of permutations of
withinRoute
,fromModel
->toModel
andbetweenModels
and nothing seems to work. There aren't any examples of these in use anywhere (that I can find).I am having partial success with liquid-bind like:
{{#liquid-bind model class="model-change" as |newProduct|}}
...
{{/liquid-bind}}
but the problem is that alot of properties used in the template are not right on the model, they are computed properties (or just controller properties). So only the properties on the
model
get the treatment.Alternatively, I can
liquid-bind
ALL properties in my templates that are not on model. but, there are alot. Failing a higher-level solution this will be my approach.The question is, are
withinRoute
,fromModel
->toModel
andbetweenModels
supported and is there any further documentation or examples available?Otherwise, I'm having good success with liquid-fire, it's a very cool addon. Thanks!
The text was updated successfully, but these errors were encountered: