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

Method ngOnInit

src/aria/tree/tree-item.ts:146–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 }
145
146 ngOnInit() {
147 const treePattern = computed(() => this.tree()._pattern);
148 const parentPattern = computed(() => {
149 if (this.parent() instanceof Tree) {
150 return treePattern();
151 }
152 return (this.parent() as TreeItemGroup<V>).ownedBy()._pattern;
153 });
154 this._pattern = new TreeItemPattern<V>({
155 ...this,
156 tree: treePattern,
157 parent: parentPattern,
158 children: computed(() => this._group()?._childPatterns()),
159 hasChildren: computed(() => !!this._group()),
160 element: () => this.element,
161 searchTerm: () => this.searchTerm() ?? '',
162 });
163 }
164
165 _register(group: TreeItemGroup<V>) {
166 this._group.set(group);

Callers

nothing calls this directly

Calls 2

computedFunction · 0.85
parentMethod · 0.80

Tested by

no test coverage detected