What is the difference between ng-if and ng-show/ng-hide

前端 未结 12 1565
执笔经年
执笔经年 2020-11-22 02:22

I\'m trying to understand the difference between ng-if and ng-show/ng-hide, but they look the same to me.

Is there a differenc

12条回答
  •  无人共我
    2020-11-22 03:02

    One interesting difference in ng-if and ng-show is:

    SECURITY

    DOM elements present in ng-if block will not be rendered in case of its value as false

    where as in case of ng-show, the user can open your Inspect Element Window and set its value to TRUE.

    And with a whoop, whole contents that was meant to be hidden gets displayed, which is a security breach. :)

提交回复
热议问题