Skip to content

ng new --viewEncapsulation Native|None|ShadowDom do nothing #13689

Closed
@kekel87

Description

@kekel87

🐞 Bug report

Command (mark with an x)

- [x] new

Description

Hi,
I try to start new project with default viewEncapsulation set to ShadowDom.
According to ng new documentation, i use --viewEncapsulation flag.

But once the project is generated and served, app-root does not have #shadow-root.
I tried all the other encapsulation but I do not see any result.

What is the expected result for this flag?
Set default shematic with "viewEncapsulation": "ShadowDom" in angular.json and generate app.component.ts with encapsulation: ViewEncapsulation.ShadowDom
OR
Add to main.ts :

bootstrapModule(AppModule, {
  defaultEncapsulation: ViewEncapsulation.ShadowDom
})

Currently it does neither of the two.

🔬 Minimal Reproduction

ng new view-test --skip-git --skip-install --viewEncapsulation ShadowDom
or
ng new view-test --skipGit --skipInstall --view-encapsulation Native
or
ng new view-test --skipGit --skipInstall --viewEncapsulation None

🌍 Your Environment

@angular/cli@7.3.1

Windows 10 64bit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions