Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the use of *ngFor and *ngIf directives.
Answer: *ngFor is a structural directive in Angular used for iterating over a list of items and creating a template for each item. *ngIf is a structural directive that conditionally includes or excludes elements based on an expression.

Example:

{{ item }}

This is shown if the condition is true
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook