Question - What is the purpose of ngIf directive?
Answer -
Sometimes an app needs to display a view or a portion of a view only under specific circumstances. The Angular ngIf directive inserts or removes an element based on a truthy/falsy condition. Let's take an example to display a message if the user age is more than 18,
18">You are not eligible for student pass!