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. extern "c" 的作用

    作用:实现C和C++混合编程. 原理:C和C++编译器编译之后,函数名会编译成不同的名字,链接阶段名字查找会找不到目标,后面实例中会详解. 用法:①.c文件中定义的函数,.cpp文件要调用时,该.cp ...

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

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

  3. MFC中GetPrivateProfileString相关函数

    项目中用到了这个函数,所以了解了一下,参考了一些博客: http://blog.sina.com.cn/s/blog_a599b5960101tsbk.html http://blog.csdn.ne ...

  4. win7 下启动mysql

    1.下载mysql最新版,解压,不用安装. 2.启动服务: 进入bin文件夹下,使用管理员权限运行 mysqld.exe. 3.测试是否启动了服务. 4.登录mysql.初次安装的,没有设置密码,直接 ...

  5. xdebug初步

    ;加载xdebug模块. 根据PHP版本来选择是zend_extension还是zend_extension_ts  ts代表线程安全  被坑过1次zend_extension="\web\ ...

  6. 设置TabBarItem选中时的图片及文字颜色

    TabBarItem选中时,默认文字和图片都变为蓝色.使用以下代码可以进行修改. MainViewController *mainVC = [[MainViewController alloc] in ...

  7. dom 侧栏分享

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  8. ubuntu 14.04 root破解

    Advanced Programmable interrupt controller 高级可编程中断控制;Advanced create table `users` (`id` int(11) not ...

  9. git(osx)上的一个git commit无法正确提交的问题

    我发现在我修改我自己的文件之后企图使用git commit编辑更加详细的争对这次提交的信息的时候 我mac上的vi编辑器貌似 出现了问题 大概报这个错. error: There was a prob ...

  10. HDU2033 人见人爱A+B 分类: ACM 2015-06-21 23:05 13人阅读 评论(0) 收藏

    人见人爱A+B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Su ...