-
Notifications
You must be signed in to change notification settings - Fork 1
Passing values into views through a template
crwang edited this page Apr 14, 2015
·
1 revision
We can pass attributes into views and other templates through the template. It's important to note that as of 2015-04-14, these attributes are for some reason lowercased on the client-side, so they do not work camelCased on the client-side, which is why I have snake-cased them here.
Also, please note the use of forEach instead of each which allows us to pass in attributes. Also, when using forEach we need to use model=value
instead of model=this
{{view "order_items/list" collection=orderItems order_status=status}}
{{#forEach _collection.models order_status=order_status}}
{{view "order_items/item" model=value order_status=order_status}}
{{/forEach}}
{{#if_eq order_status "completed"}}
Some html here
{{/if}}