Skip to content

fix(menu): mark lazy menu content as dirty before attach #16506

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
Jul 16, 2019

Conversation

jelbourn
Copy link
Member

This fixes a Google presubmit issue where the menu's @ContentChildren
aren't updated after attaching lazy MatMenuContent.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 11, 2019
@@ -39,7 +40,8 @@ export class MatMenuContent implements OnDestroy {
private _appRef: ApplicationRef,
private _injector: Injector,
private _viewContainerRef: ViewContainerRef,
@Inject(DOCUMENT) private _document: any) {}
@Inject(DOCUMENT) private _document: any,
private _changeDetectorRef: ChangeDetectorRef) {}
Copy link
Member

Choose a reason for hiding this comment

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

_changeDetectorRef should be marked as optional?

@jelbourn jelbourn force-pushed the menu-onpush-content-fix branch 2 times, most recently from b3c0d67 to 8c039f4 Compare July 11, 2019 23:02
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

@@ -39,7 +41,8 @@ export class MatMenuContent implements OnDestroy {
private _appRef: ApplicationRef,
private _injector: Injector,
private _viewContainerRef: ViewContainerRef,
@Inject(DOCUMENT) private _document: any) {}
@Inject(DOCUMENT) private _document: any,
@Optional() private _changeDetectorRef: ChangeDetectorRef) {}
Copy link
Member

Choose a reason for hiding this comment

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

The @Optional won't help with backwards compatibility. It should be marked as an optional parameter (_changeDetectorRef?: ChangeDetectorRef). Also I think we can drop the @Optional since we'll always have a ChangeDetectorRef.

@jelbourn jelbourn force-pushed the menu-onpush-content-fix branch 2 times, most recently from 61d23b2 to 1203427 Compare July 16, 2019 22:56
@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 16, 2019
This fixes a Google presubmit issue where the menu's `@ContentChildren`
aren't updated after attaching lazy `MatMenuContent`.
@jelbourn jelbourn force-pushed the menu-onpush-content-fix branch from 1203427 to 6ccf235 Compare July 16, 2019 23:05
@jelbourn jelbourn merged commit 5fb0dc6 into angular:master Jul 16, 2019
andrewseguin pushed a commit that referenced this pull request Aug 26, 2019
This fixes a Google presubmit issue where the menu's `@ContentChildren`
aren't updated after attaching lazy `MatMenuContent`.
@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 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