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).把 硬盘上的数据读取到内存中,这种操作 成为 ...
随机推荐
- 项目版本与分支管理之阿里AoneFlow模式分析
前言 在我前期的项目管理的经验中,一个项目需要维护多个产品及多个版本,这给版本与分支的管理增加了难度.前期没有重视,使得分支太多太乱,版本也没记录好,引发了很多的问题.在多种分支与版本的管理模式下,最 ...
- Swing图层的应用——实现tooltip显示
没有错是世纪前的swing. 在使用Swing的时候有个问题一直没有解决,就是Swing自带的tooltip不会跟随鼠标进行移动,而且移动到边界就会遮挡的问题.JCompoent有个createToo ...
- CSS基础:内联元素
简介 内联元素由于涉及到文本字体,读写方向,汉字和字母差异等诸多方面的影响,因此其盒模型比块级元素更加复杂,对于内联非替换元素,比如一行文本,主要由以下几种框构成: "em 框", ...
- C#之转换两个不同类型但是成员相同的对象
/// <summary> /// 转换两个不同类型但是成员相同的对象 /// </summary> /// <typeparam name="T"& ...
- c#代码输入图片
Image bgimage = Image.FromFile(flieUrl + bgImg); if (bgimage != null) { Bitmap bmp1 = new Bitmap(bgi ...
- [LeetCode] Reorganize String 重构字符串
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to ...
- [LeetCode] Fraction Addition and Subtraction 分数加减法
Given a string representing an expression of fraction addition and subtraction, you need to return t ...
- Golang中Struct与DB中表字段通过反射自动映射 - sqlmapper
Golang中操作数据库已经有现成的库"database/sql"可以用,但是"database/sql"只提供了最基础的操作接口: 对数据库中一张表的增删改查 ...
- Java爬虫原理分析
当我们需要从网络上获取资源的时候,我们一般的做法就是通过浏览器打开某个网站,然后将我们需要的东西下载或者保存下来. 但是,当我们需要大量下载的时候,这个时候通过人工一个个的去点击下载,就显得太没有效率 ...
- HDU3389 Game
Problem Description Bob and Alice are playing a new game. There are n boxes which have been numbered ...