ng-show:
ng-show element will stay in dom, just added a ng-hide attr, so it won‘t show.
ng-if:
It has its own scope.
Element is not display in the dom if not meet the requirements.
Better to use ng-if instead of ng-show.
https://egghead.io/lessons/angularjs-when-should-i-use-ng-show-or-ng-if#/tab-transcript
时间: 2024-10-12 22:29:41