feat(ivy): support template type check narrowing for *ngFor and *ngIf (#26203)
This commit adds an ngTemplateGuard_ngIf static method to the NgIf directive and an ngTemplateContextGuard static method to NgFor. The function of these two static methods is to enable type narrowing within generated type checking code for consumers of the directives. PR Close #26203
This commit is contained in:

committed by
Jason Aden

parent
868047e87f
commit
36d6e6076e
@ -101,7 +101,8 @@ class ToDoAppComponent {
|
||||
|
||||
// NON-NORMATIVE
|
||||
(ToDoAppComponent.ngComponentDef as r3.ComponentDef<any>).directiveDefs = () =>
|
||||
[ToDoItemComponent.ngComponentDef, (NgForOf as r3.DirectiveType<NgForOf<any>>).ngDirectiveDef];
|
||||
[ToDoItemComponent.ngComponentDef,
|
||||
(NgForOf as unknown as r3.DirectiveType<NgForOf<any>>).ngDirectiveDef];
|
||||
// /NON-NORMATIVE
|
||||
|
||||
@Component({
|
||||
|
Reference in New Issue
Block a user