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

Method constructor

src/aria/menu/menu-item.ts:106–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 });
105
106 constructor() {
107 effect(() => this.submenu()?.parent.set(this));
108 effect(() => this._pattern.pendingFocusEffect());
109
110 // Check for any violations after the DOM has been updated.
111 if (typeof ngDevMode === 'undefined' || ngDevMode) {
112 afterRenderEffect({
113 read: () => {
114 const violations: string[] = [];
115 if (!this.parent) {
116 violations.push('ngMenuItem must be placed inside an ngMenu or ngMenuBar container.');
117 }
118 reportViolations(violations, this.element);
119 },
120 });
121 }
122 }
123
124 ngOnInit() {
125 this.parent?._collection.register(this);

Callers

nothing calls this directly

Calls 4

reportViolationsFunction · 0.90
setMethod · 0.80
pushMethod · 0.65
pendingFocusEffectMethod · 0.45

Tested by

no test coverage detected