diff --git a/src/cdk/portal/portal.ts b/src/cdk/portal/portal.ts index 582a6017064..0e71a788b54 100644 --- a/src/cdk/portal/portal.ts +++ b/src/cdk/portal/portal.ts @@ -116,7 +116,7 @@ export class ComponentPortal extends Portal> { /** * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef). */ -export class TemplatePortal extends Portal { +export class TemplatePortal extends Portal> { /** The embedded template that will be used to instantiate an embedded View in the host. */ templateRef: TemplateRef; @@ -142,7 +142,7 @@ export class TemplatePortal extends Portal { * When a context is provided it will override the `context` property of the `TemplatePortal` * instance. */ - attach(host: PortalOutlet, context: C | undefined = this.context): C { + attach(host: PortalOutlet, context: C | undefined = this.context): EmbeddedViewRef { this.context = context; return super.attach(host); }