[Angular 2] Angular 2 Smart Components vs Presentation Components
2016-09-20 19:02
399 查看
Both Smart Components and Presentation Components receive data from Services in entirely different ways. Smart Components use constructor injection to lookup the entire service from the injector while Angular 2 Presentation components take the data from
In the app, HomeComponent is smart component, it talks to the service and handle events.
Dump Component likes WidgetOneComponent, it receive input and just displaying the data.
@Inputdefined on their component class.
In the app, HomeComponent is smart component, it talks to the service and handle events.
Dump Component likes WidgetOneComponent, it receive input and just displaying the data.
相关文章推荐
- 理解ionic2 + angular2开发方案
- [Angular 2] Share a Service Across Angular 2 Components and Modules
- 一个Angular的双向数据绑定的例子
- AngularJS中使用service,并同步数据
- angularjs中 *.min.js.map 404的问题
- 文章标题
- grunt\angularjs
- 前端框架——bootstrap/knockoutjs/angularjs
- AngularJs angular.identity和angular.noop详解
- AngularJS删除路由中的#符号的方法
- angular2 通过指令限制输入
- AngularJS中$watch和$timeout的使用示例
- AngularJS路由删除#符号解决方案
- angularjs的$filter使用
- IONIC多条聊天记渲染完毕后滚动到底部解决方案
- AngularCSS 的引入: CSS On-Demand for AngularJS
- Udemy上免费的angualr2视频教程分享
- angularjs的过滤器实现搜索与排序
- AngularJS之服务--拆穿本质,超级好理解!
- AngularJS 1.x 和TypeScript(ES6)开发的最佳实践