-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Closed
Copy link
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/portal
Description
Reproduction
Use StackBlitz to reproduce your issue:
https://stackblitz.com/edit/angular-ivy-b4babe?file=src/app/app.component.ts
Steps to reproduce:
- Attach a component portal.
- Call has attached method.
Expected Behavior
What behavior were you expecting to see?
Return true.
Actual Behavior
What behavior did you actually see?
Return false.
Environment
- Angular: 11.2.7
- CDK/Material: 11.2.6
- Browser(s): Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
Notes
The attach works fine, the issue happens because calling attachComponentPortal directly won't set _attachedPortal and hasAttached won't work as expected. A solution would be the attachs specific methods set _attachedPortal or make the attaches methods private if they are not meant to be called.
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/portal