Skip to content

Commit 196fa50

Browse files
crisbetothePunderWoman
authored andcommitted
fix(common): properly type ngComponentOutlet (#64561)
Resolves an older TODO about properly typing the `ngComponentOutlet` input. PR Close #64561
1 parent 581a05a commit 196fa50

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

goldens/public-api/common/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export class NgClass implements DoCheck {
503503
export class NgComponentOutlet<T = any> implements OnChanges, DoCheck, OnDestroy {
504504
constructor(_viewContainerRef: ViewContainerRef);
505505
get componentInstance(): T | null;
506-
ngComponentOutlet: Type<any> | null;
506+
ngComponentOutlet: Type<T> | null;
507507
// (undocumented)
508508
ngComponentOutletContent?: Node[][];
509509
// (undocumented)

packages/common/src/directives/ng_component_outlet.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ import {
100100
exportAs: 'ngComponentOutlet',
101101
})
102102
export class NgComponentOutlet<T = any> implements OnChanges, DoCheck, OnDestroy {
103-
// TODO(crisbeto): this should be `Type<T>`, but doing so broke a few
104-
// targets in a TGP so we need to do it in a major version.
105103
/** Component that should be rendered in the outlet. */
106-
@Input() ngComponentOutlet: Type<any> | null = null;
104+
@Input() ngComponentOutlet: Type<T> | null = null;
107105

108106
@Input() ngComponentOutletInputs?: Record<string, unknown>;
109107
@Input() ngComponentOutletInjector?: Injector;

0 commit comments

Comments
 (0)