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.
Loading...
Related Quiz
- You're building an admin dashboard with multiple sections like Users, Reports, and Settings. Each section has its sub-sections. What's the most efficient way to structure the routes in Angular to ensure code-splitting and modularity?
- In NgRx, what is responsible for specifying how state changes in response to actions?
- You have been tasked with improving the initial load time of an Angular application. Which of the following techniques would be most effective?
- Why is it recommended to use immutable data structures with the OnPush change detection strategy?
- Custom attribute directives can alter the appearance or behavior of an element without changing its ________.