Difference between ng if and ng show

Posted By : Deepak Agrawal | 08-Apr-2015

Difference between ng-if and ng-show in angularjs:

  1. ng-show create the dom (document object model) of html element. And check for the condition it is satisfied or not. If condition satisfied, it set the dom visibility true. Else set the  dom visibility false.
  2. In case of ng-if first condition is checked out. if condition is true. Dom is created and its visivility is true. If codition does not satified dom is not created. Or if dom is already created it will be deleted.
  3. Both have a digest loop on conditional expression and if expression result change both perform actions as per step 1 and step 2.

Hope You find this information useful.

Thanks

Hope You Find This Helpful

Thanks

Hope You Find This Helpful

Thanks

About Author

Author Image
Deepak Agrawal

Deepak is an bright developer with experience in Groovy and Grails. He is well versed with AngularJS.

Request for Proposal

Name is required

Comment is required

Sending message..