| 1. |
What Is The Difference Between Structural And Attribute Directives In Angular? |
|
Answer» STRUCTURAL directives: These are USED to alter the DOM layout by removing and adding DOM elements. It is FAR better in CHANGING the structure of the view. Examples of Structural directives are NgFor and Ngif. Attribute Directives: These are being used as characteristics of elements. For example, a DIRECTIVE such as built-in NgStyle in the template Syntax guide is an attribute directive. Structural directives: These are used to alter the DOM layout by removing and adding DOM elements. It is far better in changing the structure of the view. Examples of Structural directives are NgFor and Ngif. Attribute Directives: These are being used as characteristics of elements. For example, a directive such as built-in NgStyle in the template Syntax guide is an attribute directive. |
|