What's the difference between `ng-show` and `ng-hide`?

后端 未结 5 1498
天命终不由人
天命终不由人 2020-12-11 18:08

These attributes are both given either a true or false value, so what difference is there between them? It would make sense if there weren\'t value

5条回答
  •  清歌不尽
    2020-12-11 18:26

    i have a good scenario, let say you want to show one attribute or another depending on a validation, but not both, so using both ng-show and ng-hide like this:

    if the validation is true it would show the first div, but if it is false it would show the second div... this can be done in many more ways but is a cleaver solution for a tricky problem :D

提交回复
热议问题