feat(compiler): allow ngIf to use the ngIf expression directly as a guard
Allows a directive to use the expression passed directly to a property as a guard instead of filtering the type through a type expression. This more accurately matches the intent of the ngIf usage of its template enabling better type inference. Moved NgIf to using this type of guard instead of a function guard. Closes: #20967
This commit is contained in:

committed by
Alex Rickabaugh

parent
e48f477477
commit
82bcd83566
1
tools/public_api_guard/common/common.d.ts
vendored
1
tools/public_api_guard/common/common.d.ts
vendored
@ -276,7 +276,6 @@ export declare class NgIf {
|
||||
ngIfElse: TemplateRef<NgIfContext>;
|
||||
ngIfThen: TemplateRef<NgIfContext>;
|
||||
constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext>);
|
||||
static ngIfTypeGuard: <T>(v: T | null | undefined | false) => v is T;
|
||||
}
|
||||
|
||||
/** @stable */
|
||||
|
Reference in New Issue
Block a user