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的更多相关文章

  1. ASP.NET Core 2.1 Web API + Identity Server 4 + Angular 6 + Angular Material 实战小项目视频

    视频简介 ASP.NET Core Web API + Angular 6的教学视频 我是后端开发人员, 前端的Angular部分讲的比较差一些, 可以直接看代码!!!! 这是一个小项目的实战视频, ...

  2. angular 2 angular quick start Could not find HammerJS

    Angular2 的material中 引用了 hammerjs,遇到Could not find HammerJS错误,正确的步骤如下: 需要在如下位置增加 对material 和 hammerjs ...

  3. [Angular] Use Angular components in AngularJS applications with Angular Elements

    When migrating AngularJS (v1.x) applications to Angular you have different options. Using Angular El ...

  4. [Angular] Configurable Angular Components - Content Projection and Input Templates

    We are going to have a modal component: <au-modal > </au-modal> And we can pass default ...

  5. Angular企业级开发(10)-Smart Table插件开发

    1.Smart Table内置的分页功能 Smart Table是基于AngularJS模块特性开发出来的一款优秀的表格组件,默认就支持过滤.排序等核心功能.开发者基于它也可以开发插件,满足个性化需求 ...

  6. [Angular] Separating Structural Styles From Theme Styles - Making Components Themeable

    For the component's css file, we can improt two css files: common.css default-theme.css @import &quo ...

  7. [Angular] Refactor Angular Component State Logic into Directives

    Allow the base toggle to be a tag (<toggle>) or attribute (<div toggle>). The <toggle ...

  8. Reloading current route in Angular 5 / Angular 6 / Angular 7

    问题: angular 从子状态回到当前的父级状态的时候,父级状态不会重新初始化. https://github.com/angular-ui/ui-router/issues/2992 原文:htt ...

  9. angular+selecte2(angular ng-repeat渲染)

    一.页面代码 <select id="sponsorId" select2 ng-model="sponsorSelectedObj" ng-change ...

随机推荐

  1. bzoj 3594 [Scoi2014]方伯伯的玉米田(DP+二维BIT)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3594 [题意] 给定一个n个数的序列,有K次将一个区间内的数加1的机会,问最长不下降子 ...

  2. Python的16个“坑”

    1. 不要使用可变对象作为函数默认值 代码如下: In [1]: def append_to_list(value, def_list=[]): ...: def_list.append(value) ...

  3. IE浏览器 json异常

    当使用json数据结构时,如果对象数组最后一个元素后面依然跟一个“,”,在非IE浏览器下运行正常,但是,在IE浏览器上,则会报错. 如果使用for循环遍历对象数组时,由于后面多了一个分割符" ...

  4. 把数组A的奇数放在左边,偶数放在右边

    这也是一道面试题,是不是easy到爆,但是渣渣我面试时一点算法状态都没有 这道题和上一篇博客里那道题的解法一模一样 # include <iostream> using namespace ...

  5. 在IIS 中如何配置URL Rewrite,并且利用出站规则保持被重写的Cookie的域

    Url Rewrite配置 xx.aa.com/bb/test1.aspx 会重写到 bb.aa.com/test1.aspx 具体怎么配置入站 出站规则 结果:

  6. Python和Django的Third Libraby分类汇总

    这些第三方包与Python和Django一起构成了强大的生态系统,自己在开发时大大减小工作难度和工作量, 这些包基本上能满足我们的大部分需求.人与人的差距,其中一点是你知道的比他多,这样你就能大大提高 ...

  7. rdlc 分页操作

    工具箱中拖一个列表过来,设置 列表-->行组-->组属性常规-->组表达式=Int((RowNumber(Nothing)-1)/10)分页符-->勾选在组的结尾

  8. hdu 2199 Can you solve this equation?(高精度二分)

    http://acm.hdu.edu.cn/howproblem.php?pid=2199 Can you solve this equation? Time Limit: 2000/1000 MS ...

  9. class-dump-z下载地址

    支持MAC.Linux.Win和iOS各个版本 http://download.csdn.net/detail/yukang1989/8414567

  10. jgroups 常见概念

    组播(Multicast)传输:在发送者和每一接收者之间实现点对多点网络连接. 单播(Unicast)传输:在发送者和每一接收者之间实现点对点网络连接. 广播(Broadcast)传输:是指在IP子网 ...