An application form has a section that should only become available if the user selects a specific option in a dropdown menu. Which Angular feature would you use to conditionally display this section?

  • *ngIf directive
  • Angular routing
  • ngClass directive
  • Angular modules
To conditionally display a section in Angular based on user input, you would use the *ngIf directive (Option 1). This directive allows you to evaluate an expression and render or remove elements accordingly. Angular routing (Option 2) is used for navigating between different views, ngClass (Option 3) for applying CSS classes conditionally, and Angular modules (Option 4) are used for organizing and structuring an application.
Add your answer
Loading...

Leave a comment

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