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

fix(radio): model should update before change event is fired #456

Merged
merged 1 commit into from
May 26, 2016
Merged

fix(radio): model should update before change event is fired #456

merged 1 commit into from
May 26, 2016

Conversation

robertmesserle
Copy link
Contributor

@robertmesserle robertmesserle commented May 17, 2016

R: @jelbourn
closes #448

@googlebot googlebot added cla: yes PR author has agreed to Google's Contributor License Agreement labels May 17, 2016
/** Change event subscription set up by registerOnChange (ControlValueAccessor). */
private _changeSubscription: {unsubscribe: () => any} = null;
/** The method to be called in order to update ngModel */
private _onChangeHandler: (value: number) => void = (value) => {};
Copy link
Member

Choose a reason for hiding this comment

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

number?

Copy link
Member

Choose a reason for hiding this comment

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

What do you think of renaming this to _controlValueAccessorChangeFn? (similar for the touch one as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I have no idea where number came from.
  2. I'm for the rename - I was going to ask you to rename this for me since I had no idea what to call it.

@robertmesserle
Copy link
Contributor Author

@jelbourn rebased

@@ -273,6 +273,50 @@ describe('MdRadio', () => {
}));
});

describe('group with ngModel and change event', () => {
Copy link
Member

@jelbourn jelbourn May 19, 2016

Choose a reason for hiding this comment

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

Why not use the existing "group with ngModel" block? You can just add a change event to the existing test component without affecting the other tests.

@robertmesserle
Copy link
Contributor Author

@jelbourn Addressed comments

@robertmesserle
Copy link
Contributor Author

@jelbourn this is once again green and good to merge!

@jelbourn
Copy link
Member

LGTM

@jelbourn jelbourn merged commit c923f56 into angular:master May 26, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should md-radio-group (change) event update the model before calling the event handler?
3 participants