MCPcopy Create free account
hub / github.com/angular/components / getMenuContentPortal

Function getMenuContentPortal

src/cdk/menu/menu-trigger-base.ts:153–167  ·  view source on GitHub ↗

* Get the portal to be attached to the overlay which contains the menu. Allows for the menu * content to change dynamically and be reflected in the application.

()

Source from the content-addressed store, hash-verified

151 * content to change dynamically and be reflected in the application.
152 */
153 protected getMenuContentPortal() {
154 const hasMenuContentChanged =
155 this.menuTemplateRef !== this._menuPortal?.templateRef ||
156 this.menuData !== this._menuPortal?.context;
157 if (this.menuTemplateRef && (!this._menuPortal || hasMenuContentChanged)) {
158 this._menuPortal = new TemplatePortal(
159 this.menuTemplateRef,
160 this.viewContainerRef,
161 this.menuData,
162 this._getChildMenuInjector(),
163 );
164 }
165
166 return this._menuPortal;
167 }
168
169 /**
170 * Whether the given element is inside the scope of this trigger's menu stack.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected