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

devquora
devquora

Posted On: Feb 22, 2018

 

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.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Angular 7 Interview Questions

    What's new in Angular 7?

    Angular Elements is enabled to support content projection with the help of web standards for custom elements...

    Angular 7 Interview Questions

    What is IVY Renderer? Is it supported by Angular 7?

    Angular will be releasing a new kind of rendering pipeline and view engine...

    Angular 7 Interview Questions

    What are the Core Dependencies of Angular 7?

    Core DependenciesThere are two types of core dependencies: RxJS and TypeScript...