This lesson talks about the benefits of using the parens-based (click) syntax so that Angular 2 can handle any custom event. Then the video explains how to pass in the actually event object using the familiar $event syntax.

import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap'; @Component({
selector: 'app',
template: `
<div>
<input type="text" #myInput>
<button (mouseenter)="onClick($event, myInput.value)">Click Me</button>
</div>
`
}) class App{
onClick(event, value: string){
console.log(event, value);
}
} bootstrap(App);

[Angular 2] Event in deep的更多相关文章

  1. angular 实现tab切换(循环输出tab标题及tab下属内容,非direct,非include)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script sr ...

  2. angular(常识)

    我觉得angularjs是前端框架,而jquery只是前端工具,这两个还是没有可比性的. 看知乎上关于jquery和angular的对比http://www.zhihu.com/question/27 ...

  3. angular下H5上传图片(可多张上传)

    最近做的项目中用到了angular下上传图片功能,在做的过程中遇到了许多问题,最终都得以解决 angular上传时和普通上传时过程差不多,只不过是要不一些东西转化为angular的东西. 1.ng-f ...

  4. firefox 的event事件处理

    前几天,在用angularJs实现一个功能,点击后获取event的x,y坐标时,IE9, chrome下功能正常.但是firefox报event 未定义.初始代码如下: html: <div c ...

  5. angular面试记忆的内容

    1.ng-class的用法:ng-class="{red:true}"; 2.ng-repeat怎么可以添加重复数据.ng-repeat="item in arr tra ...

  6. angular.js中提供的基础方法

    angular.bind angular.callbacks angular.equals /* *Determines if two objects or two values are equiva ...

  7. Promise in AngularJS

    What's promise Angular’s event system provides a lot of power to our Angular apps. One of the most p ...

  8. 用postal.js在AngularJS中实现订阅发布消息

    点击查看AngularJS系列目录 用postal.js在AngularJS中实现event bus 用postal.js在AngularJS中实现event bus 理想状态下,在一个Angular ...

  9. face recognition[翻译][深度人脸识别:综述]

    这里翻译下<Deep face recognition: a survey v4>. 1 引言 由于它的非侵入性和自然特征,人脸识别已经成为身份识别中重要的生物认证技术,也已经应用到许多领 ...

随机推荐

  1. passwd-shadow文件

    [root@rusky /]# vi /etc/passwd root:x:::Redhat5:/root:/bin/bash rusky:x::::/home/rusky:/bin/bash 1.r ...

  2. Centos 下mysql安装配置

    一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...

  3. redisi配置安装

    一.单机配置 http://www.codeceo.com/article/centos-redis-setup.html 二.测试安装情况 http://blog.sina.com.cn/s/blo ...

  4. C#高级编程第1章-.NET体系结构

    内容提要: (1)编译和运行面向对象.NET代码 (2)IL/MSIL(Microsoft Intermediate Language)中间语言的优点 (3)值类型与引用类型 (4)数据类型化 (5) ...

  5. Python时间戳和日期

    import time localtime=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) prin ...

  6. 基于Spring MVC的简单HelloWorld实例

    1.导包 2.web.xml文件配置 3.包结构定义以及控制器的编写 4.xxxx-servlet文件配置 5.返回的视图(jsp)编写   6.源码 下载:http://download.csdn. ...

  7. Oracle 11g XML java连接

    在网上找了好多教程 走好好多弯路 现在从头总结下 oralce11g 可以直接用xmltype节点存储xml文件 简单来说就是直接存一个文件进去 首先安装oracle11g 网上教程非常多 然后进Ne ...

  8. java下socket传图片

    package cn.stat.p4.ipdemo; import java.io.File; import java.io.FileOutputStream; import java.io.IOEx ...

  9. myeclipseb笔记(4):拷贝文件的相应配置

    在MyEclipse中,经常需要用到拷贝工程文件,但是直接拷贝的话,就会出现访问不了的情况,如下: 原文件learn/StudManage/login.jsp,访问: 拷贝工程,改名,访问: 就出现了 ...

  10. boost

    参考博客 http://www.cnblogs.com/lidabo/p/3805487.html http://www.cppblog.com/Robertxiao/archive/2013/01/ ...