angular5の学習。CLIを使用した角度作成コンポーネントはカプセル化を提供します:ViewEncapsulation.None
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css'],
encapsulation: ViewEncapsulation.None
})
export class ExampleComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
しかしencapsulation: ViewEncapsulation.None
はコードブレークを行い、次のエラーメッセージを出す:どのように
は、私が知っているが、私は新しいコンポーネントを作成するために、角度のCLIを使用するとき、私は、次のコードを取得しますencapsulation: ViewEncapsulation.None
を削除するだけでバグを修正してください。しかし、最初にこのコード行を持たない方法はありますか?
'@Engine/core'から' ViewEncapsulation'をインポートしていますか? –