user12359058
user12359058

Reputation:

Is it possible to link an external style sheet in a particular component??(not globally)

I want 2 components in an angular 6 application

I wish first component to use bootstrap min.css file , and the other not

how can i implement this

Upvotes: 0

Views: 119

Answers (1)

Chirag Chaudhari
Chirag Chaudhari

Reputation: 1827

you can use ViewEncapsulation for that.

 @Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css'],
  encapsulation: ViewEncapsulation.ShadowDom
})

Using shadow dom ensures that your base project styling will not be applied.

Upvotes: 1

Related Questions