2017-10-21 17 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" 
     } 

}

nodeUmodule 디렉토리에있는 CSS 파일에 styleURLs []이 (가) 접근하는 것을 차단하고 있다고 생각합니다. 어떻게 차단합니까? ?

답변

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'] 
})