What is the difference between Structural and Attribute directives in Angular?

Member

bria_metz

by bria_metz , in category: Technology , 2 months ago

What is the difference between Structural and Attribute directives in Angular?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by zella , 2 months ago

Structural directives 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 Nglf.

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.