A list of child controllers created for each item curentlyin the list.
The component's controller.
The name of the local property.
The component's element.
The generator used to create the component.
The object that is looped over.
The template for creating items.
This static property defines which properties of the componentshould be available in its local scope which will be used by thecomponent's behaviors as well as by the defining element's children.
Values of this array represent the name of one of the component'sproperties that will be pushed to the local scope.
export default class MyComponent extends Component { static locals = ['firstName', 'lastName'];}
Updates the DOM when the list of items has changed.
The For component can be used to loop over objects inside of templates.It creates a new local variable available for every iteration. It can bedefined in the each attribute. The object to loop over is retrievedfrom evaluating the expression defined in the of attribute.
In the local scope of each item there are also two special propertiesavailable: $index and $key. The names speak for themselves.
Example
A simple example that loops over a list of users.
<for each="user" of="users"> <user> <h3>${ user.name }</h3> </user></for>
{ default } from mahalo/components/for