Skip to content

Commit 1749315

Browse files
authored
Merge pull request ember-learn#699 from Charizard/angle-bracket-built-ins/routing
Update docs for the built-in components for routing/specifying-a-routes-model.md
2 parents 32df71a + ba92ad0 commit 1749315

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

guides/release/routing/specifying-a-routes-model.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,34 @@ photo's ID (`params.photo_id`) as an argument to Ember Data's `findRecord`
8585
method.
8686

8787
Note: A route with a dynamic segment will always have its `model` hook called when it is entered via the URL.
88-
If the route is entered through a transition (e.g. when using the [link-to](../../templates/links/) Handlebars helper),
89-
and a model context is provided (second argument to `link-to`), then the hook is not executed.
88+
If the route is entered through a transition (e.g. when using the [`<LinkTo />`](../../templates/links/) component),
89+
and a model object is provided, then the hook is not executed.
9090
If an identifier (such as an id or slug) is provided instead then the model hook will be executed.
9191

92-
For example, transitioning to the `photo` route this way won't cause the `model` hook to be executed (because `link-to`
93-
was passed a model/):
92+
For example, transitioning to the `photo` route this way won't cause the `model` hook to be executed (because `<LinkTo />`
93+
was passed a model):
9494

9595
```handlebars {data-filename=app/templates/photos.hbs}
9696
<h1>Photos</h1>
9797
{{#each this.model as |photo|}}
9898
<p>
99-
{{#link-to "photo" photo}}
99+
<LinkTo @route="photo" @model={{photo}}>
100100
<img src="{{photo.thumbnailUrl}}" alt="{{photo.title}}" />
101-
{{/link-to}}
101+
</LinkTo>
102102
</p>
103103
{{/each}}
104104
```
105105

106-
while transitioning this way will cause the `model` hook to be executed (because `link-to` was passed `photo.id`, an
106+
while transitioning this way will cause the `model` hook to be executed (because `<LinkTo />` was passed `photo.id`, an
107107
identifier, instead):
108108

109109
```handlebars {data-filename=app/templates/photos.hbs}
110110
<h1>Photos</h1>
111111
{{#each this.model as |photo|}}
112112
<p>
113-
{{#link-to "photo" photo.id}}
113+
<LinkTo @route="photo" @model={{photo.id}}>
114114
<img src="{{photo.thumbnailUrl}}" alt="{{photo.title}}" />
115-
{{/link-to}}
115+
</LinkTo>
116116
</p>
117117
{{/each}}
118118
```

0 commit comments

Comments
 (0)