Skip to content

refactor(material/dialog): use type overload for open method #11731

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 1 commit into from
Oct 14, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jun 9, 2018

  • Reworks the MatDialog.open method to use overloads, rather than the single signature that has componentOrTemplateRef: ComponentType<T> | TemplateRef<T>. This makes the separation clearer and looks nicer in autocompletion.
  • Adds docs for the MatBottomSheet.open method.

@crisbeto crisbeto requested a review from jelbourn as a code owner June 9, 2018 10:17
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 9, 2018
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 target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jun 11, 2018
@jelbourn
Copy link
Member

Turns out this is a major change because people wrap MatDialog in their own service that passes ComponentType<T> | TemplateRef<T>, which no longer fits either definition

@crisbeto crisbeto added target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Oct 18, 2018
@crisbeto crisbeto force-pushed the dialog-open-overloads branch from c98efaf to 0ea193c Compare January 5, 2019 15:46
@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
@crisbeto crisbeto force-pushed the dialog-open-overloads branch from 0ea193c to 0dab2b5 Compare May 28, 2019 22:06
@benneq
Copy link

benneq commented Jun 20, 2019

Here's the correspondig TypeScript issue: microsoft/TypeScript#14107
Maybe within this issue you can find a workaround for it ❓

@crisbeto crisbeto force-pushed the dialog-open-overloads branch from 0dab2b5 to 1505567 Compare August 25, 2019 14:06
@crisbeto crisbeto added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jan 5, 2020
@crisbeto crisbeto force-pushed the dialog-open-overloads branch from 1505567 to 05c29df Compare January 5, 2020 20:50
@mmalerba mmalerba removed the lgtm label Jul 31, 2020
@crisbeto crisbeto force-pushed the dialog-open-overloads branch from 05c29df to c0e6270 Compare October 12, 2020 21:37
@crisbeto crisbeto changed the title refactor(dialog): use type overload for open method refactor(material/dialog): use type overload for open method Oct 12, 2020
* Reworks the `MatDialog.open` method to use overloads, rather than the single signature
that has `componentOrTemplateRef: ComponentType<T> | TemplateRef<T>`. This makes
the separation clearer and looks nicer in autocompletion.
* Adds docs for the `MatBottomSheet.open` method.
@crisbeto crisbeto force-pushed the dialog-open-overloads branch from c0e6270 to 3342fd9 Compare October 13, 2020 20:46
@annieyw annieyw merged commit 70e9eb9 into angular:master Oct 14, 2020
annieyw pushed a commit that referenced this pull request Oct 14, 2020
* Reworks the `MatDialog.open` method to use overloads, rather than the single signature
that has `componentOrTemplateRef: ComponentType<T> | TemplateRef<T>`. This makes
the separation clearer and looks nicer in autocompletion.
* Adds docs for the `MatBottomSheet.open` method.

(cherry picked from commit 70e9eb9)
@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 Nov 14, 2020
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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants