Skip to content

feat(cdk-experimental/menu): Use DI instead of CdkMenuPanel to connect menus #24558

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 3 commits into from
Mar 15, 2022

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Mar 9, 2022

This PR aims to simplify the API by eliminating MenuPanel, which was a directive that existed purely to glue together other components and directives. Specifically it was used to pass along the MenuStack and to associate a Menu with the trigger that opened it.

In the reworked API, MenuStack becomes injectable and we create a new base class for all menu triggers, MenuTrigger that is also injectable. The new injectables work as follows:

  • All MenuTrigger provide both MenuStack and MenuTrigger to any Menu they open
  • All Menu injects an optional MenuStack and MenuTrigger
  • All Menu registers with its injected MenuStack and MenuTrigger at ngOnInit

@mmalerba mmalerba changed the title WIP: rework cdk menu API feat(cdk-experimental/menu): Use DI instead of CdkMenuPanel to connect menus Mar 10, 2022
@mmalerba mmalerba marked this pull request as ready for review March 10, 2022 00:07
@mmalerba mmalerba added the target: major This PR is targeted for the next major release label Mar 10, 2022
@mmalerba mmalerba requested a review from crisbeto March 10, 2022 00:12
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker merge safe and removed action: merge The PR is ready for merge by the caretaker labels Mar 14, 2022
@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker and removed merge safe labels Mar 14, 2022
@mmalerba mmalerba merged commit dc020c7 into angular:master Mar 15, 2022
forsti0506 pushed a commit to forsti0506/components that referenced this pull request Apr 3, 2022
…t menus (angular#24558)

* feat(cdk-experimental/menu): Use DI instead of CdkMenuPanel to connect menus

* fixup! feat(cdk-experimental/menu): Use DI instead of CdkMenuPanel to connect menus

* fixup! feat(cdk-experimental/menu): Use DI instead of CdkMenuPanel to connect menus
@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 Apr 15, 2022
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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants