From 70bc4d56e18e8078446a4604c6130de8b856a3e1 Mon Sep 17 00:00:00 2001 From: William Lohan Date: Sun, 12 May 2019 21:29:49 -0700 Subject: [PATCH] fix(portal): correct return type of TemplatePortal.attach (#14602) Fixes #14584 BREAKING CHANGE The return type of `TemplatePortal.attach` previously had an incorrect signature: `TemplatePortal.attach(...): C`. This should actually have been `TemplatePortal.attach(...): EmbeddedViewRef`. The type has been corrected. --- src/cdk/portal/portal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }