Angular 2: When to use attribute directives and when to use component styles?
There are 2 main ways to style an element in Angular 2 described in the official Angular 2 Docs.
- Attribute Directives
- Component Styles
Component styles can be implementated in these ways: (Template Inline Styles, Style URLs in Metadata, Template Link Tags, CSS @imports)
I'm interested in which ways to use to apply styles to elements, when.
Since they're all mentioned in the official docs, each of them may be best to use in certain circumstances (even template inline styles in some circumstances??)?
The docs demo attribute directives are responding to user events. They demo component styles without events.
Does this mean that in most circumstances, it is good practice to use attribute directives when styling is applied in response to events, and component styles when styling is applied without events?