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

Method constructor

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

Source from the content-addressed store, hash-verified

119 _pattern!: TreeItemPattern<V>;
120
121 constructor() {
122 super();
123 effect(onCleanup => {
124 const parent = this.parent();
125 const tree = this.tree();
126 untracked(() => {
127 if (parent instanceof TreeItemGroup) {
128 parent._register(this);
129 }
130 tree._collection.register(this);
131 });
132 onCleanup(() => {
133 if (parent instanceof TreeItemGroup) {
134 parent._unregister(this);
135 }
136 tree._collection.unregister(this);
137 });
138 });
139 afterRenderEffect({
140 write: () => {
141 this.contentVisible.set(this._pattern.expanded());
142 },
143 });
144 }
145
146 ngOnInit() {
147 const treePattern = computed(() => this.tree()._pattern);

Callers

nothing calls this directly

Calls 7

parentMethod · 0.80
unregisterMethod · 0.80
setMethod · 0.80
expandedMethod · 0.80
_registerMethod · 0.45
registerMethod · 0.45
_unregisterMethod · 0.45

Tested by

no test coverage detected