Closed arggh closed 6 years ago
Gonna need a repro. The following works:
Template.body.viewmodel({
onRendered(instance) {
console.log(instance);
}
});
I have no idea what happened then. Probably some silly human error. I just tried this in a random component and indeed it works like you said. Sorry for the trouble, closing.
onCreated
andonDestroyed
receive the current template instance as argument, so stuff like this is convenient:Is there a reason, why
onRendered
doesn't receive the template instance as argument? In Blaze it's bound asthis
in all three life cycle functions, so it would make sense to have a similar behavior across all of them in ViewModel as well?