...

>

Model Resolution

Model Resolution

Here, you’ll learn about a rookie trap in Ember.js by making little changes in our application.

Since we are talking about router subtleties in this chapter, let’s see a rookie trap.

Make the following tiny change in the band-list ...

JavaScript (JSX)
{{!-- app/components/band-list.hbs --}}
<ul class="pl-2 pr-8">
{{#each this.bands as |item|}}
<li class="mb-2">
<LinkTo
class={{if item.isActive "border-purple-400 border-l-4 pl-2"}}
@route="bands.band"
{{!-- @model={{item.band.id}} --}}
@model={{item.band}}
>
{{item.band.name}}
</LinkTo>
</li>
{{/each}}
</ul>

Instead of passing the id of ...

Access this course and 1800+ top-rated courses and projects.