Attribute Directives
Attribute directives are a way of changing the appearance or behavior of a component or a native DOM element. Ideally, a directive should work in a way that is component agnostic and not bound to implementation details.
For example, Angular has built-in attribute directives such as ngClass
and ngStyle
that work on any component or element.
原文: https://angular-2-training-book.rangle.io/handout/directives/attribute_directives.html