Adding New Items
Rendering new items
If you want to render a new item to the page:
- Render items using a
{{#for}}
loop
{{#for item in items}}
<div object key:name="@innerText">{{item.name}}</div>
{{/for}}
- Reference the name in the for loop in a
new:
attribute
<button new:item>Create new item</button>
- Remake will take care of the rest
- Remake searches the page for a matching
name
in a{{#for}}
loop on the page (if none is found, it searches theapp/partials
directory) - Remake renders the inner part of the
{{#for}}
loop - Remake adds the rendered item to the nearest element with a
list
tag (tip: you can customize where it adds the item by specifying a selector as the value of thenew:
attribute)