Skip to content

Commit 9eff890

Browse files
AndrewKushnirthePunderWoman
authored andcommitted
refactor(core): strict templates type-checking compatibility for perf tests (angular#44905)
This commit updates a type used in the transplanted views perf tests, to make the test compatible with strict template type-checking. Currently, compiling the perf test results in the following TS error: ``` error TS2322: Type 'TemplateRef<{}>' is not assignable to type 'TemplateRef<NgForOfContext<any, any[]>>'. 17 <ng-container *ngFor="let n of views; template: template; trackBy: trackByIndex"></ng-container> ~~~~~~~~ ``` PR Close angular#44905
1 parent 889de82 commit 9eff890

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import {NgForOfContext} from '@angular/common';
910
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, NgModule, TemplateRef, ViewChild} from '@angular/core';
1011
import {BrowserModule} from '@angular/platform-browser';
1112

@@ -19,7 +20,7 @@ import {newArray} from '../util';
1920
changeDetection: ChangeDetectionStrategy.OnPush
2021
})
2122
export class InsertionComponent {
22-
@Input() template !: TemplateRef<{}>;
23+
@Input() template!: TemplateRef<NgForOfContext<any, any[]>>;
2324
views: any[] = [];
2425
@Input()
2526
set viewCount(n: number) {

0 commit comments

Comments
 (0)