Skip to content

fix(button): avoid direct access to nativeElement for consistency #16056

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

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

codef0rmer
Copy link

No description provided.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 18, 2019
@@ -98,7 +98,7 @@ export class MatButton extends _MatButtonMixinBase
// attributes, add the correct corresponding class.
for (const attr of BUTTON_HOST_ATTRIBUTES) {
if (this._hasHostAttributes(attr)) {
(elementRef.nativeElement as HTMLElement).classList.add(attr);
this._getHostElement().classList.add(attr);
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add a return type of HTMLElement to _getHostElement in this PR? That will ensure that the type safety remains

Copy link
Author

Choose a reason for hiding this comment

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

Done :-)

@codef0rmer codef0rmer force-pushed the fix/button-native-el-reference branch from 57ae009 to facdaf5 Compare May 21, 2019 05:52
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed labels May 21, 2019
@jelbourn
Copy link
Member

Commit message should be:

chore(button): re-use common function for getting native element

@codef0rmer codef0rmer force-pushed the fix/button-native-el-reference branch from facdaf5 to 6edd0d3 Compare May 22, 2019 05:32
@codef0rmer
Copy link
Author

Done.

@jelbourn jelbourn merged commit a2d91e4 into angular:master Jun 19, 2019
RudolfFrederiksen pushed a commit to RudolfFrederiksen/material2 that referenced this pull request Jun 21, 2019
@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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants