Explain the use of Ng-If, Ng-Switch, And Ng-Repeat directives in AngularJS ?

devquora
devquora

Posted On: Feb 22, 2018

 

ng-if – This directive removes a portion of the DOM tree, which is based on the expression.
In case the expression is assigned to ng-if, it evaluates to a false value, and then the element is deleted from the DOM tree, or else a clone of the element is reinserted into the DOM.
ng-switch – This directive is used based on a scope expression to conditionally swap DOM structure on the template.
The ng-switch default directive will be preserved at the specific location in a template.
ng-repeat – This directive is used to instantiate the template once per item from a collection.
Each template which is instantiated gets its own scope where the given loop variable is set to the current collection of item.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions