Skip to content
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

[DOC] Document setupController hook behavior when model is undefined #14982

Merged
merged 2 commits into from
Jul 6, 2017

Conversation

Bestra
Copy link
Contributor

@Bestra Bestra commented Mar 3, 2017

The default hook implementation doesn't update the model property of the controller
if the resolved model is undefined, and I don't think that behavior is recorded anywhere except the source itself.

The default implementation doesn't update the `model` property of the controller
if the resolved model is undefined.  This isn't currently documented.
@Bestra Bestra changed the title Document setupController hook behavior when model is undefined [DOC] Document setupController hook behavior when model is undefined Mar 3, 2017
@locks locks requested a review from rwjblue April 1, 2017 13:33
@@ -1703,7 +1703,8 @@ let Route = EmberObject.extend(ActionHandler, Evented, {
model supplied by the `model` hook.

By default, the `setupController` hook sets the `model` property of
the controller to the `model`.
the controller to the `model`. If `model` is `undefined`, the default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of stating the default then correcting it with what happens when model is undefined, can we tweak how we state the default?

Perhaps something like:

By default, the setupController hook sets the model property of the controller to the model specified when it is not undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure!

One good sentence is better than two.
@locks locks merged commit e32073b into emberjs:master Jul 6, 2017
@locks
Copy link
Contributor

locks commented Jul 6, 2017

Thanks @Bestra :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants