Angular basic interview question- What is the use of ngFor and ngIf?

Anil Kumar
May 25, 2023
Photo by Nomad Bikers on Unsplash

ngFor and ngIf both are directive of type structural.

Structural directive which change dom behaviour add and remove.

ngIf is make element show and hide based on condition(expression).

ngFor is directive used for repeating the element of array/list/collection.

--

--