码迷,mamicode.com
首页 > 其他好文 > 详细

[Angular 2] Angular 2 Smart Components vs Presentation Components

时间:2016-09-20 19:58:50      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

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 @Input defined 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.

 

[Angular 2] Angular 2 Smart Components vs Presentation Components

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5890026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!