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

  1. Angular2中Input和Output

    @Input @Input是用来定义模块的输入的,用来让父模块往子模块传递内容: @Output 子模块自定义一些event传递给父模块用@Output. 对于angular2中的Input和Outp ...

  2. [20160704]Addition program that use JOptionPane for input and output

    //Addition program that use JOptionPane for input and output. import javax.swing.JOptionPane; public ...

  3. Python Tutorial 学习(七)--Input and Output

    7. Input and Output Python里面有多种方式展示程序的输出.或是用便于人阅读的方式打印出来,或是存储到文件中以便将来使用.... 本章将对这些方法予以讨论. 两种将其他类型的值转 ...

  4. [Python] Print input and output in table

    Print the input and output in a table using prettyTable. from prettytable import PrettyTable import ...

  5. Input and Output File

    Notes from C++ Primer File State Condition state is used to manage stream state, which indicates if ...

  6. [20171128]rman Input or output Memory Buffers.txt

    [20171128]rman Input or output Memory Buffers.txt --//做一个简单测试rman 的Input or output Memory Buffers. 1 ...

  7. Angular4学习笔记(六)- Input和Output

    概述 Angular中的输入输出是通过注解@Input和@Output来标识,它位于组件控制器的属性上方. 输入输出针对的对象是父子组件. 演示 Input 新建项目connInComponents: ...

  8. Python - 3. Input and Output

    from:http://interactivepython.org/courselib/static/pythonds/Introduction/InputandOutput.html Input a ...

  9. Java中的IO流,Input和Output的用法,字节流和字符流的区别

    Java中的IO流:就是内存与设备之间的输入和输出操作就成为IO操作,也就是IO流.内存中的数据持久化到设备上-------->输出(Output).把 硬盘上的数据读取到内存中,这种操作 成为 ...

随机推荐

  1. 一个关于C8051F350模拟电源的小问题

    前言 多做重要而不紧急的工作,慢慢的就会发现重要而紧急的工作没那么多了 工作方法 今天有好几个同事出差去现场实验了,为了今天的顺利成行,昨天加了个班,但是从项目管理的角度或者说做事的方法上来讲,这次加 ...

  2. 使用生成器把Kafka写入速度提高1000倍

    title: 使用生成器把Kafka写入速度提高1000倍 toc: true comment: true date: 2018-04-13 21:35:09 tags: ['Python', '经验 ...

  3. OpenGL中glUniform1i使用

    在OpenGL中使用glGetUniformLocation和glUniformxxx等函数时,要在之前启用对应的着色器程序,即调用glUseProgram.

  4. 1.UTF8字符集csv文件在oracle下乱码问题处理

    1.问题描述 在excel中生成了一个UTF-8编码格式的csv文件准备导入数据库,在notpad++下打开显示正常,编码集为UTF-8,通过pl/sql dev导入oracle是出现乱码,此时初步推 ...

  5. Django REST framework+Vue 打造生鲜超市(十)

    十一.pycharm远程代码调试 第三方登录和支付,都需要有服务器才行(回调url),我们可以用pycharm去远程调试服务器代码 服务器环境搭建 以全新阿里云centos7系统为例: 11.1.阿里 ...

  6. c#之文件操作(学习笔记)

    File类和Directory类 FileInfo类 需要提供一个文件路径来创建一个FileInfo类实例对象,FileInfo提供很多类似File的方法,在选择使用File还是FileInfo时应遵 ...

  7. mysql-5.7.18-winx64 免安装版配置

    如题,最新的都是只有免安装版的,可以官网下载zip的压缩包. 下载后解压,如下 下面就开始配置 1.在path中添加环境变量 ;D:\coding\mysql-5.7.18-winx64\bin; ← ...

  8. ●BZOJ 3527 [Zjoi2014]力

    题链: http://www.lydsy.com/JudgeOnline/problem.php?id=3527 题解: FFT求卷积. $$\begin{aligned}E_i&=\frac ...

  9. ●BZOJ 2560 串珠子

    题链: http://www.lydsy.com/JudgeOnline/problem.php?id=2560 题解: 容斥,状压计数dp 首先求出一个数组 g[s] 表示集合内的点的连边方案数(两 ...

  10. hdu 5464(dp)

    题意: 给你n个数,要求选一些数(可以不选),把它们加起来,使得和恰好是p的倍数(0也是p的倍数),求方案数. - - 心好痛,又没想到动规 #include <stdio.h> #inc ...