diff --git a/docs/views/template-syntax/view-attributes.md b/docs/views/template-syntax/view-attributes.md index 107cf6d6..dddfb1f7 100644 --- a/docs/views/template-syntax/view-attributes.md +++ b/docs/views/template-syntax/view-attributes.md @@ -188,6 +188,42 @@ this.container.querySelectorAll('*'); this.modal.close(); ``` + +### `asArray` attribute + +Similar to the `as` attribute, a property with the name of the attribute value is made available on the component but in this case is an `array`. Used by views in a `each` block to provide a reference in the controller to the individual item. + +```jinja +{{each items as #item, #index}} + {{#item}} +{{/each}} +``` + +```js +this.itemEditor[index]; // references the Component or DOM element for item at `index` +``` + +### `asObject` attribute + +Similar to the `as-array` attribute, a property with the name of the attribute value is made available on the component. This attribute takes a second argument that is the proptery key to use as the property on the object. + +```jinja +