Update rendering-values.md with example of how to return a component from a function#1966
Update rendering-values.md with example of how to return a component from a function#1966BryanCrotaz wants to merge 3 commits intoember-learn:masterfrom
Conversation
Add example of function to return a dynamic component
✅ Deploy Preview for ember-guides ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
correct return type of someComponent function
update comments
MinThaMie
left a comment
There was a problem hiding this comment.
Thanks for this example, I'm wondering if it needs a little bit of text too. What this does :)
|
It's about the same as all the other examples on the page. Can we merge this change, and then iterate on the page's tone and verbiage overall separately? |
|
"or via a property on this object" only showed the template, and not how to define the property. I've filled that gap. It was only showing half of the how-to. |
|
Aaah, since your component is called |
|
No we shouldn't rename, because that would be REALLY confusing. The only reason you'd do this would be to dynamically change which component you're providing. Having the name of one of those choices match the property name would not make sense. In most other places the template and component code are placed alongside each other without extraneous words. |
| ```handlebars | ||
| <this.someComponent /> | ||
| ``` | ||
| ```ts |
There was a problem hiding this comment.
There shouldn't be any TypeScript in the guides (yet). There is a whole process that is underway to add a typescript version of the guides but until that is done then you should write all your backing JS as JS 👍
| @@ -71,6 +71,25 @@ or via a property on some object | |||
| ```handlebars | |||
There was a problem hiding this comment.
If we are trying to equate this file to the JS backing it then we should specify the filename for both. There is information in the styleguide on how to do this https://github.com/ember-learn/guides-source/blob/master/CONTRIBUTING.md#style-guide

Add example of function to return a dynamic component