的documentation爲ng-hide
說,它只是增加了一個CSS指令:角JS NG隱藏和非常大的圖像
<!-- when $scope.myValue is truthy (element is hidden) -->
<div ng-hide="myValue" class="ng-hide"></div>
<!-- when $scope.myValue is falsy (element is visible) -->
<div ng-hide="myValue"></div>
將其定義爲:
.ng-hide {
/* this is just another form of hiding an element */
display: block!important;
position: absolute;
top: -9999px;
left: -9999px;
}
如果我有一個很大圖像,超過9999像素的任何維度,是不是會侵入視口?
有沒有任何安全隱患?由於隱藏元素仍然在DOM中,所以任何人都可以看到它。這是否意味着我應該使用ng-if
來獲取敏感數據?
<div ng-if="userType == admin">
< list of user names and passwords>
ngIf對於敏感數據來說似乎更合理 – shershen