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:
Mitar
2014-10-30 21:13:14 -07:00
committed by David Glasser
parent 111fe5d6ef
commit e85fdc9059

View File

@@ -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`.