mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
docs: can use currentData inside template.autorun
I think it is important to stress that you can use Template.currentData inside template.autorun, because you cannot use it inside Tracker.autorun, it throws an error that current view does not exist.
This commit is contained in:
@@ -172,10 +172,11 @@ Access is read-only and non-reactive.
|
||||
|
||||
{{> autoApiBox "Blaze.TemplateInstance#autorun"}}
|
||||
|
||||
You can use `this.autorun` from a [`onCreated`](#template_onCreated) or
|
||||
You can use `this.autorun` from an [`onCreated`](#template_onCreated) or
|
||||
[`onRendered`](#template_onRendered) callback to reactively update the DOM
|
||||
or the template instance. The Computation is automatically stopped
|
||||
when the template is destroyed.
|
||||
or the template instance. You can use `Template.currentData()` inside
|
||||
of this callback to access reactive data context of the template instance.
|
||||
The Computation is automatically stopped when the template is destroyed.
|
||||
|
||||
Alias for `template.view.autorun`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user