Skip to content

Content projection with slot doesn't always work #36039

@guillaume-moreau

Description

@guillaume-moreau

🐞 bug report

Affected Package

Don't know :/

Is this a regression?

I don't think so.

Description

I have components that I want to use as Angular Elements.
In order to do that I use slot and ViewEncapsulation.ShadowDom for content projection.
The content projection works when using ng serve but not in storybook or as an Angular Elements.

I have no idea why it does not work.

🔬 Minimal Reproduction

I've made a repro with stackblitz.
When my component is used as root component it works :
https://stackblitz.com/edit/angular-srq66r

But not when it's not the root component
https://stackblitz.com/edit/angular-b8e9l4

🔥 Exception or Error


🌍 Your Environment

Angular Version:


Angular CLI: 7.0.7
Node: 10.15.3
OS: win32 x64
Angular: 9.0.6
... animations, common, compiler, core, forms, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.10.7
@angular-devkit/build-optimizer   0.10.7
@angular-devkit/build-webpack     0.10.7
@angular-devkit/core              7.0.7
@angular-devkit/schematics        7.0.7
@angular/cli                      7.0.7
@angular/compiler-cli             7.0.4
@angular/language-service         7.0.4
@ngtools/webpack                  7.0.7
@schematics/angular               7.0.7
@schematics/update                0.10.7
rxjs                              6.5.4
typescript                        3.1.6
webpack                           4.19.1

(not sure about version, I've just downloaded the stackblitz and did ng version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtime

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions