Which directive is utilized to switch between multiple views, but only one view can be displayed at a time?

  • *ngFor
  • *ngIf
  • *ngModel
  • *ngSwitch
The *ngSwitch directive in Angular is used to switch between multiple views, but only one view can be displayed at a time based on a specified condition. It's commonly used for rendering different templates or components depending on the value of an expression. The other directives listed, such as *ngFor, *ngIf, and *ngModel, have different purposes and don't provide the same view-switching behavior.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *