components icon indicating copy to clipboard operation
components copied to clipboard

ComponentPortal attached to PortalHost not rendered when content is projected using *ngTemplateOutlet

Open glenstaes opened this issue 9 years ago • 2 comments

Bug:

ComponentPortal attached to PortalHost not rendered when content is projected using *ngTemplateOutlet

What is the expected behavior?

When a ComponentPortal is attached to the PortalHost the component should be rendered within the *ngTemplateOutlet

What is the current behavior?

The component is not rendered even though the portal is successfully attached. 2017-11-20_16-01-45

What are the steps to reproduce?

https://stackblitz.com/edit/angular-di4q3k?file=app%2Fprojection.component.ts

What is the use-case or motivation for changing an existing behavior?

I'm building a master-detail component that renders a different component based on the subroute that is used.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular v5.0.1 Angular CDK v5.0.0-rc.0

glenstaes avatar Nov 21 '17 07:11 glenstaes

(revisiting older issues as part of a triaging fix-it)

Looking at your stackblitz, you've got a directive on ng-content, which isn't actually supported by the framework. ng-content is a compiler primitive that can't have any directives or attributes applied. If there's still some problem without that, feel free to open a new issue.

jelbourn avatar May 26 '20 20:05 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.