-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Update rendering-values.md with example of how to return a component from a function #1966
base: master
Are you sure you want to change the base?
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
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.
very nice!
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.
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. |
@@ -71,6 +71,25 @@ or via a property on some object | |||
```handlebars | |||
<this.someComponent /> | |||
``` | |||
```ts |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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