From e85fdc905906c7dce0a6718da089496e9eeb6712 Mon Sep 17 00:00:00 2001 From: Mitar Date: Thu, 30 Oct 2014 21:13:14 -0700 Subject: [PATCH] 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. --- docs/client/full-api/api/templates.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/client/full-api/api/templates.md b/docs/client/full-api/api/templates.md index 85f8e52534..37d1199203 100644 --- a/docs/client/full-api/api/templates.md +++ b/docs/client/full-api/api/templates.md @@ -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`.