Explain directives ng-if, ng-switch and ng-repeat?

Answer Posted / chaitanya

ng-if – This directive can add / remove HTML elements from the DOM based on an expression. If the expression is true, it add HTML elements to DOM, otherwise HTML elements are removed from the DOM.

ng-switch – This directive can add / remove HTML elements from the DOM conditionally based on scope expression.

ng-repeat - This directive is used to iterate over a collection of items and generate HTML from it.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is service in angularjs with example?

427


How can you add an active class to a selected element in a list component?

479


What are the differences between angular and jquery?

405


How can we fix it?

478


Why use pipes?

460






What is constant?

467


What is components in angular?

416


Explain digest life-cycle in AngularJS?

2918


How did you reverse a string?

418


Explain the concept of scope hierarchy? How many scope can an application have?

434


What is route guard?

396


What is semantic element in html?

433


Name the types of linking function?

416


How to bind to user input events to component event handlers?

418


Explain what is testability like in Angular?

465