angularJs的ng-if判断如果是false的话里面的内容是否加载了?
我知道ng-if如果判断为false的话,里面的内容不会显示,在源码中也不会显示,但是我想知道的是,这个不会显示代表什么,里面的内容是已经加载了但是由于判断的问题就没有显示,还是判断是false后里面的内容根本就没有加载
ng-if判断结果如果为false,那么不会加载(没有DOM结构)。ng-show 判断结果如果为false, then, only it will not be displayed on the page, but it will still be loaded (display:none).
ng-if
false
ng-show
It’s the latter. If ng-if is false, the angular template inside will no longer appear and will be deleted, and the logic in ng-if will not be executed, and of course the data will not be rendered. The former you are talking about is ng-hide ng-show
ng-if
判断结果如果为false
,那么不会加载(没有DOM结构)。ng-show
判断结果如果为false
, then, only it will not be displayed on the page, but it will still be loaded (display:none).It’s the latter. If ng-if is false, the angular template inside will no longer appear and will be deleted, and the logic in ng-if will not be executed, and of course the data will not be rendered. The former you are talking about is ng-hide ng-show