[AngularJS] ng-if vs ng-show
2015-11-12 03:27
567 查看
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
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
相关文章推荐
- Yeoman官方教程:用Yeoman和AngularJS做Web应用
- AngularJS实现跨域请求
- 浅谈angularJs中的$watch的用法
- AngularJs ngHref、ngSrc、ngCopy/ngCut/ngPaste
- Web 组件 Header
- angularJS之$watch用法
- Ionic/Angular中Controllers探秘
- angular源码目录结构
- angularjs 如何处理checkbox
- AngularJs开发实践第一天(1)
- AngularJS快速入门
- angularJS实例之购物车
- angularjs 学习笔记
- angularJS的路由ngRoute
- angularJS的实战(视频)
- angularJS的directive
- AngularJS 中文资料+工具+库+Demo 大搜集
- angularJS源码目录结构和文件的解读
- Ionic 2.0 Alpha版本发布了
- AngularJS之移动开发