You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can use the `{{#each}}...{{/each}}` syntax to iterate and loop through the array returned by the model hook. For each iteration through the array—for each item in the array—we will render the block that is passed to it once. In our case, the block is our `<Rental>` component, surrounded by `<li>` tags.
364
366
365
-
Inside of the block we have access to the item of the *current* iteration with the `{{rental}}`variable. But why `rental`? Well, because we named it that! This variable comes from the `as |rental|` declaration of the `each`loop. We could have just as easily called it something else, like `as |property|`, in which case we would have to access the current item through the `{{property}}` variable.
367
+
Inside of the block we have access to the item of the *current* iteration with the `{{property}}`variable. But why `property`? Well, because we named it that! This variable comes from the `as |property|` declaration of the `each`loop. We could have just as easily called it something else, like `as |rental|`, in which case we would have to access the current item through the `{{rental}}` variable.
366
368
367
369
Now, let's go over to our browser and see what our index route looks like with this change.
0 commit comments