Sashko's comments

This commit is contained in:
Slava Kim
2015-02-24 10:55:43 -08:00
parent 59c9c72450
commit 0af4a8ff7c

View File

@@ -45,8 +45,8 @@ Helpers can accept positional and keyword arguments:
```javascript
Template.myTemplate.helpers({
displayName: function (firstName, lastName, kw) {
var prefix = kw.hash.title ? kw.hash.title + " " : "";
displayName: function (firstName, lastName, keyword) {
var prefix = keyword.hash.title ? keyword.hash.title + " " : "";
return prefix + firstName + " " + lastName;
}
});
@@ -62,9 +62,10 @@ You can learn more about arguments to helpers in [Spacebars
Readme](https://atmospherejs.com/meteor/spacebars).
Under the hood, each helper starts a new
[`Tracker.autorun`](#/full/tracker_autorun), when its reactive dependencies
change, the helper is rerun. Helpers depend on their data context, passed
arguments and other reactive data sources accessed during execution.
[`Tracker.autorun`](#/full/tracker_autorun). When its reactive
dependencies change, the helper is rerun. Helpers depend on their data
context, passed arguments and other reactive data sources accessed during
execution.
To create a helper that can be used in any template, use
[`Template.registerHelper`](#template_registerhelper).