TemplatePortal class signature: possible typo #14584
Labels
help wanted
The team would appreciate a PR from the community to address this issue
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
It seems like the
TemplatePortal
class signaturehttps://github.com/angular/material2/blob/fe7f95ec10acd9e660f7037be8d006c9e264a57b/src/cdk/portal/portal.ts#L119
should actually be
and
https://github.com/angular/material2/blob/fe7f95ec10acd9e660f7037be8d006c9e264a57b/src/cdk/portal/portal.ts#L145
should be
The generic parameter for
Portal
is for the type that theattach(host: PortalOutlet): T
method returns. That returns whatPortalOutlet
'sattach(portal: Portal<any>): any;
returns. Note: This could beattach<T>(portal: Portal<T>): T;
couldn't it If you look at the implementation ofPortalOutlet
,BasePortalOutlet
, it's overload forattach()
when passing aTemplatePortal
isattach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
notattach<T>(portal: TemplatePortal<T>): T;
like you'd expect based on theTemplatePortal
class signature.The text was updated successfully, but these errors were encountered: