-
-
Notifications
You must be signed in to change notification settings - Fork 519
Update Controller Index #46
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
Conversation
guides/v3.1.0/controllers/index.md
Outdated
|
||
Controllers behave like a specialized type of Component that is rendered by | ||
the router when entering a Route. | ||
[Controllers](https://emberjs.com/api/ember/release/classes/Controller) are a routable object that is used to decorate the model returned by the router when entering a Route. A Controller is usually paired with an individual Route of the same name. |
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.
Can you make this singular? A controller is a routable object...
[Controllers](https://emberjs.com/api/ember/release/classes/Controller) are a routable object that is used to decorate the model returned by the router when entering a Route. A Controller is usually paired with an individual Route of the same name. | ||
|
||
The controller receives a single property from the Route – `model` – which is | ||
the return value of the Route's `model()` method. |
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.
I think we need to mention these two lines above somewhere explicitly
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.
This is what I mean by routable :) but yes agree I'll bring this back in
</div> | ||
Yes! Controllers are still an integral part of an Ember application architecture, and generated by the framework even if you don't declare a Controller module explicitly. | ||
|
||
###### When should we create a Controller? |
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.
Can the content of this section be rolled into "When and where to use controllers"?
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.
Thoughts on leaving this here? I think it might be quoted a bit and wanted it in the same place for people to see
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.
I'm fine with either
Thank you @chrisrng! I added some comments. I really like the the "where & when" section and the places you've simplified some of the language. I am curious about this sentence:
I don't know enough about controllers myself to know if this is accurate. Can you tell me more about it? |
@jenweber I quite like @chrisrng's line about decorating a model, but I would be a tiny bit concerned about the wording 🤔
that suggests that its only purpose is to decorate the model, which is not true. You also can make use of controllers if you're not using models in some cases, even if it's not recommended 😂 @chrisrng how about:
or
Again this might need a look over from someone who knows more about controllers than I do 😂 |
@jenweber thanks for the review! I added an example to explain that sentence more (see below). Rewrote the first paragraph into the following:
|
One more update to adhere to Contributing guide (fixed links and commit message) |
Thank you for the edits! I want to get one more person to sign off on the "routable object" definition and we'll be good to merge :D I ran the app locally and everything renders great. |
@jenweber I'm 👍 with the introduction section if that's what you mean? 😂 but as it's quite an important section it might be worth asking others too 😖 |
@mansona I have received one comment that "routable" is incorrect, and a few other people saying it's fine, so I asked in #dev-ember and didn't hear back yet. I'm going to merge and if I get more clarification, we can correct it. It's related to the route, so it's routable, ok :P |
Merged, thank you @chrisrng! |
First draft in tackling #34
rendered