Closed mickmcgrath13 closed 7 years ago
So, this works:
<can-import from="can-stache-animate/demos/inserted-animations"
{^value.animations}="*animations" />
{{#*animations}}
<div class="demo-wrap">
<div class="demo"
($inserted)="*animations.customFadeIn" />
</div>
{{/*animations}}
..but it would be really nice if we didn't have to wrap it like that
Probably the best way around this would be to either do the above ({{#*animations}}
) or register helpers for the animations that you want to use for inserted:
import canStacheAnimate from 'can-stache-animate';
import stache from 'can-stache';
export default Component.extend({
...
helpers:{
fadeIn: canStacheAnimate.animations.fadeIn
}
});
Possible Future Alternative: Register all animations as stache helpers
Right now,
$inserted
doesn't seem to fire when its RHS is beingcan-import
ed. Perhaps it fires but the thing beingcan-import
ed hasn't resolved, yet?In this example,
*animations.customFadeIn
doesn't run...but in the following example,
handleInserted
does run (it's on the viewModel). See the inserted demo