Skip to content

Commit 8cda408

Browse files
committed
use backing class
1 parent c2c7a2a commit 8cda408

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

guides/release/routing/linking-between-routes.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,19 @@ the currently active one, you can pass an array of model objects using the
193193

194194
```gjs {data-filename=app/templates/photos.gjs}
195195
import { LinkTo } from '@ember/routing';
196+
import { array } from '@ember/helper';
197+
198+
export default class {
199+
get latestComments() {
200+
return this.model.sort((a, b) => new Date(b.date) - new Date(a.date)).slice(0, 5);
201+
}
202+
}
196203
197204
<template>
198205
<h1>Latest Comments</h1>
199206
200207
<ul>
201-
{{#each @controller.latestComments as |comment|}}
208+
{{#each this.latestComments as |comment|}}
202209
<li>
203210
<LinkTo @route="photos.photo.comment" @models={{array comment.photo comment}}>
204211
{{excerpt comment.body}}...

0 commit comments

Comments
 (0)