-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/portaldocsThis issue is related to documentationThis issue is related to documentationgood first issueThis issue is a good place to start for first time contributors to the projectThis issue is a good place to start for first time contributors to the projecthelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue
Description
The official doc says:
The content of this template is captured by the portal.
The content of this template is captured by the portal.
A component can use @ViewChild or @ViewChildren to get a reference to a CdkPortal.
However, @ViewChild('theElementRef')
binds to undefined
when I use the *cdkPortal
notation,
while it works when I use <ng-template cdkPortal>
I suspect *cdkPortal
makes the element to leave the page before afterViewInit()
.
Maybe the documentation should encourage using the <ng-template>
form instead.
Affected documentation page: https://material.angular.io/cdk/portal/overview#portals-in-practice
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/portaldocsThis issue is related to documentationThis issue is related to documentationgood first issueThis issue is a good place to start for first time contributors to the projectThis issue is a good place to start for first time contributors to the projecthelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue