Skip to content

Commit

Permalink
fix(common): allow null in ngComponentOutlet (#46280)
Browse files Browse the repository at this point in the history
`ngComponentOutlet` already handles null/undefined values, but the types don't reflect that. These changes update the types.

Fixes #45716.

PR Close #46280
  • Loading branch information
crisbeto authored and jessicajaniuk committed Jun 9, 2022
1 parent 16c71fc commit ef5cba3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion goldens/public-api/common/index.md
Expand Up @@ -416,7 +416,7 @@ export class NgClass implements DoCheck {
export class NgComponentOutlet implements OnChanges, OnDestroy {
constructor(_viewContainerRef: ViewContainerRef);
// (undocumented)
ngComponentOutlet: Type<any>;
ngComponentOutlet: Type<any> | null;
// (undocumented)
ngComponentOutletContent?: any[][];
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/directives/ng_component_outlet.ts
Expand Up @@ -70,7 +70,7 @@ import {ComponentRef, createNgModuleRef, Directive, Injector, Input, NgModuleFac
*/
@Directive({selector: '[ngComponentOutlet]'})
export class NgComponentOutlet implements OnChanges, OnDestroy {
@Input() ngComponentOutlet!: Type<any>;
@Input() ngComponentOutlet: Type<any>|null = null;

@Input() ngComponentOutletInjector?: Injector;
@Input() ngComponentOutletContent?: any[][];
Expand Down

0 comments on commit ef5cba3

Please sign in to comment.