Difference between structural and attribute directives in Angular?

Viewed 5228

What is difference between structural and attribute directives in Angular

2 Answers

Structural directives are used for shaping or reshaping HTML DOM by adding, removing elements.

Attribute directives are used to change the appearance or behavior of DOM element.

  1. we can apply many attribute directives to one host element. But can apply one structural directive to a host element.
  2. A structure directive basically deals with manipulating the dom elements by typically adding or removing, or manipulating elements. But "attribute directives" are deal with changing the look and behavior of the DOM element
Related