concept attribute directive in category angular

appears as: ttribute directives, n attribute directive, The attribute directive, attribute directive, Attribute directives
Testing Angular Applications

This is an excerpt from Manning's book Testing Angular Applications.

Use attribute directives when you’re trying to change the appearance of a DOM element. A good example of an attribute directive is the one we mentioned earlier where you were changing the background color of a row in a table to highlight it as a user rolled over the row.

Angular in Action

This is an excerpt from Manning's book Angular in Action.

Attribute directives are like our earlier example, where they modify the appearance or behavior of an element. The NgClass directive is one such example provided by Angular out of the box, which we saw in chapter 2. There are a number of built-in attribute directives, so you won’t necessarily have to build many of your own. Typically, they work by changing the various properties of the element they are associated with, such as the NgClass directive changing the list of classes attached. Most directives are attribute directives.

  • Attribute directives are the most common to create and are great for modifying an existing element.