Difference between ng-if and ng-show in angularjs:
- 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.
- 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.
- 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
More From Oodles
Ready to innovate? Let's get in touch
Request for Proposal
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Deepak Agrawal
Deepak is an bright developer with experience in Groovy and Grails. He is well versed with AngularJS.