| 106 | } |
| 107 | |
| 108 | @Component({ |
| 109 | selector: 'testItem', |
| 110 | template: `<div>{{value}}</div>`, |
| 111 | }) |
| 112 | class TestItemComponent implements HasElement, OnDestroy { |
| 113 | readonly element = inject(ElementRef).nativeElement as HTMLElement; |
| 114 | private readonly _parent = inject(TestCollectionComponent); |
| 115 | |
| 116 | @Input() value!: string; |
| 117 | |
| 118 | constructor() { |
| 119 | afterNextRender(() => { |
| 120 | this._parent._collection.register(this); |
| 121 | }); |
| 122 | } |
| 123 | |
| 124 | ngOnDestroy() { |
| 125 | this._parent._collection.unregister(this); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | @Component({ |
| 130 | template: ` |
nothing calls this directly
no outgoing calls
no test coverage detected