-
-
Notifications
You must be signed in to change notification settings - Fork 511
Convert routing section to route components #2118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gjs
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ember-guides ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
<h1>Posts</h1> | ||
{{!-- Display posts and other content --}} | ||
{{outlet}} | ||
```handlebars {data-filename=templates/posts.gjs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still in draft I see, but just quickly noticed this should be gjs
instead of handlebars
for all code blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a few missed spots.
I also think there needs to be a general introduction / explanation that route templates are components (cross-linking to component docs) with special arguments @model
and @controller
(see https://rfcs.emberjs.com/id/1046-template-tag-in-routes).
I think we should say 'route component' instead of 'template'.
@@ -65,7 +65,7 @@ Router.map(function() { | |||
``` | |||
|
|||
The route defined above will by default use the `blog-post.js` route handler, | |||
the `blog-post.hbs` template, and be referred to as `blog-post` in any | |||
the `blog-post.gjs` template, and be referred to as `blog-post` in any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above here (I cannot comment on unedited lines) are references to template
and examples of hbs that need to be converted.
@@ -109,17 +109,22 @@ ember generate route posts/new | |||
And then add the `{{outlet}}` helper to your template where you want the nested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be saying 'route component' rather than 'template'?
@@ -16,5 +16,5 @@ the `posts.new` route will render `posts/new.hbs`. | |||
|
|||
Each template will be rendered into the `{{outlet}}` of its parent route's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text above here references hbs
@@ -216,25 +234,33 @@ instead. | |||
When you provide a string or number to the `<LinkTo>`, the dynamic segment's `model` hook will run when the app transitions to the new route. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References above here to hbs
link text to display | ||
</LinkTo> | ||
{{/each}} | ||
</template> | ||
``` | ||
|
||
If you decide to pass the entire model, be sure to cover this behavior in your [application tests](../../testing/testing-application/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handlebars below here
No description provided.