user4401
user4401

Reputation: 446

How do I decide when to write a directive or just global css classes in angular2

Assuming I have a situation when we want to enchant some of our html with a nice reusable css style I have two options:

In which situations should I use the first solution and in which the second?

Upvotes: 0

Views: 42

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657476

If CSS can do what you want, I would stick with CSS. If you need more flexibility that is hard to achieve with CSS alone I would try to make it work using a directive.

Upvotes: 1

Related Questions