Skip to content

Instantly share code, notes, and snippets.

@chrism
Created November 10, 2015 12:23
Show Gist options
  • Save chrism/f592a70ee06e186c0ed4 to your computer and use it in GitHub Desktop.
Save chrism/f592a70ee06e186c0ed4 to your computer and use it in GitHub Desktop.
<h3>All Owners</h3>
<ul>
{{#each model as |owner|}}
<li>
{{owner.name}}
<ul>
{{#each owner.pets as |pet|}}
<li>{{#link-to 'index' (query-params petName=pet.name)}}{{pet.name}}{{/link-to}}</li>
{{/each}}
</ul>
</li>
{{/each}}
</ul>
<h3>Owners with a pet called {{input value=petName}}</h3>
{{#if filteredOwners.isPending}}
<p>Loading owners...</p>
{{else}}
<ul>
{{#each filteredOwners as |owner|}}
<li>
{{owner.name}}
</li>
{{else}}
<li>No owners found...</li>
{{/each}}
</ul>
{{/if}}
{{outlet}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment