Skip to content

Commit 8b9c32d

Browse files
crisbetothePunderWoman
authored andcommitted
fix(common): allow null in ngComponentOutlet (#46280)
`ngComponentOutlet` already handles null/undefined values, but the types don't reflect that. These changes update the types. Fixes #45716. PR Close #46280
1 parent 8115031 commit 8b9c32d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

goldens/public-api/common/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ export class NgClass implements DoCheck {
416416
export class NgComponentOutlet implements OnChanges, OnDestroy {
417417
constructor(_viewContainerRef: ViewContainerRef);
418418
// (undocumented)
419-
ngComponentOutlet: Type<any>;
419+
ngComponentOutlet: Type<any> | null;
420420
// (undocumented)
421421
ngComponentOutletContent?: any[][];
422422
// (undocumented)

packages/common/src/directives/ng_component_outlet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import {ComponentRef, createNgModuleRef, Directive, Injector, Input, NgModuleFac
7070
*/
7171
@Directive({selector: '[ngComponentOutlet]'})
7272
export class NgComponentOutlet implements OnChanges, OnDestroy {
73-
@Input() ngComponentOutlet!: Type<any>;
73+
@Input() ngComponentOutlet: Type<any>|null = null;
7474

7575
@Input() ngComponentOutletInjector?: Injector;
7676
@Input() ngComponentOutletContent?: any[][];

0 commit comments

Comments
 (0)