@@ -85,34 +85,34 @@ photo's ID (`params.photo_id`) as an argument to Ember Data's `findRecord`
85
85
method.
86
86
87
87
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.
90
90
If an identifier (such as an id or slug) is provided instead then the model hook will be executed.
91
91
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):
94
94
95
95
``` handlebars {data-filename=app/templates/photos.hbs}
96
96
<h1>Photos</h1>
97
97
{{#each this.model as |photo|}}
98
98
<p>
99
- {{#link-to "photo" photo}}
99
+ <LinkTo @route= "photo" @model={{ photo}}>
100
100
<img src="{{photo.thumbnailUrl}}" alt="{{photo.title}}" />
101
- {{/link-to}}
101
+ </LinkTo>
102
102
</p>
103
103
{{/each}}
104
104
```
105
105
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
107
107
identifier, instead):
108
108
109
109
``` handlebars {data-filename=app/templates/photos.hbs}
110
110
<h1>Photos</h1>
111
111
{{#each this.model as |photo|}}
112
112
<p>
113
- {{#link-to "photo" photo.id}}
113
+ <LinkTo @route= "photo" @model={{ photo.id}}>
114
114
<img src="{{photo.thumbnailUrl}}" alt="{{photo.title}}" />
115
- {{/link-to}}
115
+ </LinkTo>
116
116
</p>
117
117
{{/each}}
118
118
```
0 commit comments