| 2103 | const A = new InjectionToken('A'); |
| 2104 | |
| 2105 | @Directive({ |
| 2106 | selector: '[dir]', |
| 2107 | providers: [{provide: A, useValue: 'A'}], |
| 2108 | standalone: false, |
| 2109 | }) |
| 2110 | class SomeDir { |
| 2111 | constructor( |
| 2112 | @Inject(A) private tokenA: string, |
| 2113 | private elementRef: ElementRef, |
| 2114 | ) {} |
| 2115 | |
| 2116 | ngAfterViewInit() { |
| 2117 | this.elementRef.nativeElement.innerHTML = this.tokenA; |
| 2118 | } |
| 2119 | } |
| 2120 | |
| 2121 | const SomeComponent = getAOTCompiledComponent(true, [SomeDir]); |
| 2122 | TestBed.configureTestingModule({imports: [SomeComponent]}); |
nothing calls this directly
no test coverage detected
searching dependent graphs…