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

Expose isIconButton publicly #11226

Merged
merged 5 commits into from
May 10, 2018
Merged

Expose isIconButton publicly #11226

merged 5 commits into from
May 10, 2018

Conversation

DavidSouther
Copy link
Contributor

No description provided.

@DavidSouther DavidSouther requested a review from tinayuangao as a code owner May 8, 2018 17:53
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 8, 2018
@jelbourn
Copy link
Member

jelbourn commented May 8, 2018

@DavidSouther could you talk about your use-case for needing these APIs?

@jelbourn jelbourn added the needs: discussion Further discussion with the team is needed before proceeding label May 8, 2018
@DavidSouther
Copy link
Contributor Author

@jelbourn We have a "Progress Button" which replaces the content with an ng-spinner while awaiting an observable. It seems silly to have both @ContentChild(MatButton) as well as @ContentChild('button[mat-icon-button]') when we could just ask the button itself whether it's an icon button. And since FAB is right there, I just figured I'd expose that as well.

@@ -77,9 +77,15 @@ export class MatButton extends _MatButtonMixinBase

/** Whether the button is round. */
_isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');
get isRoundButton(): boolean {
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 making these getters, could you just make the existing properties public and readonly? TypeScript generates a fair amount more code for getters, so it's better to avoid when you don't also need a setter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More than happy to, wanted to avoid what might be perceived as a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

We consider anything prefixed with an underscore to be a private API, so it should be okay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. PTAL. I only found the one if block, and the few .html references in this repo.

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: minor This PR is targeted for the next minor release and removed needs: discussion Further discussion with the team is needed before proceeding labels May 9, 2018
@jelbourn jelbourn merged commit 318d699 into angular:master May 10, 2018
@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 8, 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 target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants