When to favor ng-if vs. ng-show/ng-hide?

前端 未结 7 1432
陌清茗
陌清茗 2020-11-22 08:39

I understand that ng-show and ng-hide affect the class set on an element and that ng-if controls whether an element is rendered as par

相关标签:
7条回答
  • 2020-11-22 09:10

    ng-if on ng-include and on ng-controller will have a big impact matter on ng-include it will not load the required partial and does not process unless flag is true on ng-controller it will not load the controller unless flag is true but the problem is when a flag gets false in ng-if it will remove from DOM when flag gets true back it will reload the DOM in this case ng-show is better, for one time show ng-if is better

    0 讨论(0)
提交回复
热议问题