diff --git a/goldens/public-api/common/common.d.ts b/goldens/public-api/common/common.d.ts index 8a6d5c0155..339f0b753d 100644 --- a/goldens/public-api/common/common.d.ts +++ b/goldens/public-api/common/common.d.ts @@ -243,7 +243,7 @@ export declare class NgIf { set ngIfThen(templateRef: TemplateRef> | null); constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef>); static ngTemplateGuard_ngIf: 'binding'; - static ngTemplateContextGuard(dir: NgIf, ctx: any): ctx is NgIfContext>; + static ngTemplateContextGuard(dir: NgIf, ctx: any): ctx is NgIfContext>; } export declare class NgIfContext { diff --git a/packages/common/src/directives/ng_if.ts b/packages/common/src/directives/ng_if.ts index e103313678..26704b8592 100644 --- a/packages/common/src/directives/ng_if.ts +++ b/packages/common/src/directives/ng_if.ts @@ -232,7 +232,8 @@ export class NgIf { * The presence of this method is a signal to the Ivy template type-check compiler that the * `NgIf` structural directive renders its template with a specific context type. */ - static ngTemplateContextGuard(dir: NgIf, ctx: any): ctx is NgIfContext> { + static ngTemplateContextGuard(dir: NgIf, ctx: any): + ctx is NgIfContext> { return true; } } diff --git a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts index 6d084e5baa..377179e736 100644 --- a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts +++ b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts @@ -72,7 +72,7 @@ export declare class NgIf { ngIfThen: TemplateRef> | null; constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef>); static ngTemplateGuard_ngIf: 'binding'; - static ngTemplateContextGuard(dir: NgIf, ctx: any): ctx is NgIfContext>; + static ngTemplateContextGuard(dir: NgIf, ctx: any): ctx is NgIfContext>; static ɵdir: i0.ɵɵDirectiveDefWithMeta, '[ngIf]', never, {'ngIf': 'ngIf'}, {}, never>; } @@ -818,7 +818,7 @@ export declare class AnimationEvent { template: '
{{u.name}}
', }) class TestCmp { - user: {name: string}|null; + user: {name: string}|null|false; } @NgModule({ @@ -842,7 +842,7 @@ export declare class AnimationEvent { template: '
{{u.name}}
', }) class TestCmp { - user: {name: string}|null; + user: {name: string}|null|false; } @NgModule({