You're building a tabbed interface where only one tab content is displayed at a time, and others are conditionally hidden. Which built-in directive would be most useful to achieve this?

  • ngFor Directive
  • ngIf Directive
  • ngShow Directive
  • ngSwitch Directive
To create a tabbed interface where only one tab content is displayed at a time and others are conditionally hidden, the ngIf directive would be most useful. ngIf is a structural directive that conditionally adds or removes elements from the DOM based on a condition. You can use it to conditionally render the content of the selected tab while hiding others.
Add your answer
Loading...

Leave a comment

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