2017-10-21 5 views
0

Angular-Cliを使用してフロントエンドアプリケーションを実行しています。Angular Cli- In StyleURL node_moduleディレクトリにあるCSSファイルを追加します。

node_moduleからその特定のコンポーネントにのみCSSファイルを追加します。 []配列、

は、私は次のコンポーネントがあります:私はAngular.cli.json "スクリプト" にCSSファイルを追加したくない「から

インポート{コンポーネント、のOnInitを} @angular /コア'; @Component({
セレクタ 'fbsign成分' templateUrl './fb.signin.component.html'

styleUrls: ['./fb.signin.component.css', '../../node_modules/bootstrap-social/bootstrap-social.css'] }) 

エクスポートクラスFbSigninComponent {

constructor(){} 

    ngOnInit(): any{} 

     onClick(){ 
       window.location.href ="http://localhost:1337/facebook" 
     } 

}

私は、何かがstyleURLs []がnode_moduleディレクトリにあるcssファイルにアクセスするのをブロックしていると思います。どのようにブロックを解除するのですか? ?

答えて

0

は次のように試してみてください:

以下home.component.tsファイルである私のプロジェクト内の場所次ここ

SRC =>アプリ=>ホーム

home.component.ts

@Component({ 
    selector: 'app-home', 
    templateUrl: './home.component.html', 
    styleUrls: ['./home.component.css', '../../../node_modules/bootstrap/dist/css/bootstrap.css'] 
}) 
関連する問題