Angular2的input和output(原先的properties和events)
angular2学习笔记
本文地址:http://blog.csdn.net/sushengmiyan
本文作者:苏生米沿
文章来源:http://blog.ng-book.com/angular-2-component-inputs-and-inputs-formerly-properties-and-events/
angular2的开发迭代笔记快,其中一个重大API变化就是组件(components)现在有input和outputs了。
过去,我们这样定义一个组件:
@Component({
selector: 'my-component',
properties: ['product'],
events: ['onAdd']
}}
现在不一样了:
@Component({
selector: 'my-component',
inputs: ['product'],
outputs: ['onAdd']
}}
这个API的改动是有争议的,不过它也是有意义的。
关于这个争议,在git上有激烈的讨论,感兴趣的可以看下:
https://github.com/angular/angular/pull/4435#issuecomment-144789359
Angular2的input和output(原先的properties和events)的更多相关文章
- Angular2中Input和Output
@Input @Input是用来定义模块的输入的,用来让父模块往子模块传递内容: @Output 子模块自定义一些event传递给父模块用@Output. 对于angular2中的Input和Outp ...
- [20160704]Addition program that use JOptionPane for input and output
//Addition program that use JOptionPane for input and output. import javax.swing.JOptionPane; public ...
- Python Tutorial 学习(七)--Input and Output
7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转 ...
- [Python] Print input and output in table
Print the input and output in a table using prettyTable. from prettytable import PrettyTable import ...
- Input and Output File
Notes from C++ Primer File State Condition state is used to manage stream state, which indicates if ...
- [20171128]rman Input or output Memory Buffers.txt
[20171128]rman Input or output Memory Buffers.txt --//做一个简单测试rman 的Input or output Memory Buffers. 1 ...
- Angular4学习笔记(六)- Input和Output
概述 Angular中的输入输出是通过注解@Input和@Output来标识,它位于组件控制器的属性上方. 输入输出针对的对象是父子组件. 演示 Input 新建项目connInComponents: ...
- Python - 3. Input and Output
from:http://interactivepython.org/courselib/static/pythonds/Introduction/InputandOutput.html Input a ...
- Java中的IO流,Input和Output的用法,字节流和字符流的区别
Java中的IO流:就是内存与设备之间的输入和输出操作就成为IO操作,也就是IO流.内存中的数据持久化到设备上-------->输出(Output).把 硬盘上的数据读取到内存中,这种操作 成为 ...
随机推荐
- NetCore2.0技术文章目录
记录NetCore2.0的学习和工作,理解对与错不重要,重要的是,我飘~~~过 ------------------------------------------------------------ ...
- Python系列之 - 装饰器
装饰器主要是用来对函数的操作,我们把定义的函数比作一个蛋糕的话,那么装饰器就是盒子,如果要吃蛋糕就先打开盒子.具体到程序中就是在函数外层又套了一层,套的那一层就是一个装饰器.这么说可能有点抽象,那么我 ...
- 告知服务器意图的http方法
1.GET 用来获取资源,返回已有的结果 2.POST 传输实体主体,返回处理过后的结果 3.PUT 向服务器传输文件,返回是否成功的状态码 4.DELETE 删除服务器文件,返回是否成功的状态码 5 ...
- 给工作添点乐趣--- 为Idea编译时打印图案
控制台输出图案--banner 之前用vs开发时,也可以自己设置编译时控制台打印出的图案,我们管它叫banner. 给idea设置banner 先见一下效果图 还有重磅的 好了.其实设置这个很简单.分 ...
- 1114innodb的统计信息对optimizer成本预估影响实例 CARDINALITY
转自 https://www.cnblogs.com/olinux/p/5140615.html 转自 https://yq.aliyun.com/articles/174906?spm=5176 ...
- MVC系列 引入MVC
1.必须的类库 system.web.Mvc system.Web.Razor system.web.webPages system.web.webpages.razor 添加方式如下图 2.MVC项 ...
- ML笔记:Classification: Logistic Regression
- python3进阶之推导式之列表(list)推导式(comprehensions)
1.前言 推导式,英文名字叫comprehensions,注意与comprehension(理解)只有s字母之差.推导式又可以叫解析式,推导式可以从一种数据序列构建新的数据序列的结构体.推导式分为,列 ...
- [NOIp 2013]货车运输
Description A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路.每一条道路对车辆都有重量限制,简称限重.现在有 q 辆货车在运输货物, 司机们想知道每辆车在不超过车辆限重 ...
- 洛谷P2221 [HAOI2012]高速公路
线段树 #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> ...