1

Getting error below when adding component with CLI. Version: angular-cli: 1.0.0-beta.21 node: 6.4.0 os: win32 x64

D:\GIT#####>ng g component test
installing component create
src\app\test\test.component.css create
src\app\test\test.component.html create
src\app\test\test.component.spec.ts create
src\app\test\test.component.ts viewEncapsulation is not defined (Error in blueprint template:
D:\GIT\PartnerOrders2\node_modules\angular-cli\blueprints\component\files__path____name__.component.ts),

Anyone have an idea how to solve?

2
  • Perhaps you're missing an import? Please post the code that causes the error. Commented Nov 30, 2016 at 10:58
  • This is just a "add component", can't share the whole app-code. Commented Nov 30, 2016 at 11:00

2 Answers 2

1

It's a known bug in the angular-cli.

https://github.com/angular/angular-cli/issues/3264

Sign up to request clarification or add additional context in comments.

Comments

0

Add

import { Component, ViewEncapsulation } from '@angular/core';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.