[Angular 2] Event in deep
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的更多相关文章
- angular 实现tab切换(循环输出tab标题及tab下属内容,非direct,非include)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script sr ...
- angular(常识)
我觉得angularjs是前端框架,而jquery只是前端工具,这两个还是没有可比性的. 看知乎上关于jquery和angular的对比http://www.zhihu.com/question/27 ...
- angular下H5上传图片(可多张上传)
最近做的项目中用到了angular下上传图片功能,在做的过程中遇到了许多问题,最终都得以解决 angular上传时和普通上传时过程差不多,只不过是要不一些东西转化为angular的东西. 1.ng-f ...
- firefox 的event事件处理
前几天,在用angularJs实现一个功能,点击后获取event的x,y坐标时,IE9, chrome下功能正常.但是firefox报event 未定义.初始代码如下: html: <div c ...
- angular面试记忆的内容
1.ng-class的用法:ng-class="{red:true}"; 2.ng-repeat怎么可以添加重复数据.ng-repeat="item in arr tra ...
- angular.js中提供的基础方法
angular.bind angular.callbacks angular.equals /* *Determines if two objects or two values are equiva ...
- Promise in AngularJS
What's promise Angular’s event system provides a lot of power to our Angular apps. One of the most p ...
- 用postal.js在AngularJS中实现订阅发布消息
点击查看AngularJS系列目录 用postal.js在AngularJS中实现event bus 用postal.js在AngularJS中实现event bus 理想状态下,在一个Angular ...
- face recognition[翻译][深度人脸识别:综述]
这里翻译下<Deep face recognition: a survey v4>. 1 引言 由于它的非侵入性和自然特征,人脸识别已经成为身份识别中重要的生物认证技术,也已经应用到许多领 ...
随机推荐
- 使用spring @Scheduled注解运行定时任务、
曾经框架使用quartz框架运行定时调度问题. 老大说这配置太麻烦.每一个调度都须要多加在spring的配置中. 能不能降低配置的量从而提高开发效率. 近期看了看spring的 scheduled的使 ...
- 显示目录树命令tree
-a:显示所有文件,包括隐藏文件 -d:只显示目录 -f:显示完整的文件名,包含路径 -L:显示目录树的深度 [root@rusky /]# tree -L -a -f /home /home |-- ...
- DataGrid( 数据表格) 组件[7]
本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于Panel(面板).Resizeable(调整大小).LinkButton(按钮).Pageination( ...
- mvc自带的异步表单提交
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- Linux命令初步了解
知识点: 1.虚拟控制台: 在系统启动时直接进入字符工作方式后,系统提供了多个(默认为6个)虚拟控制台.每个虚拟控制台可以相互独立使用,互不影响. 可以使用Alt+F1~Alt+F6进行多个虚拟控制台 ...
- django: form fileupload - 2
继续介绍文件上传的第二种形式和第三种形式. ------------------------------------------------------------- 第二种形式较简单,直接用 DB ...
- css如何实现背景透明,文字不透明?
之前做了个半透明弹层,但设置背景半透明时,子元素包含的字体及其它元素也都变成了半透明.对opacity这个属性认识的不透彻,在这里做一些总结,方便以后使用. 背景透明,文字不透明的解决方法: ...
- (转)js学习笔记()函数
1.调用函数时,如果参数多于定义时的个数,则多余的参数将会被忽略,如果少于定义时的个数则缺失的参数数会被自动赋予undefined值. 2.如果是用function语句声明的函数定义则不可以出现在循环 ...
- Arcgis - Personal Geodatabase 和 File Geodatabase的区别.
一.平台支持: 1.Personal Geodatabase:仅可在Windows 上运行: 2.File Geodatabase:跨平台支持,可在Windows 及UNIX.linux上运行. 评 ...
- 3 windows环境与shell交互操作
/** * 由SshConfig配置获取一个Session * @param conf * @return */ public static Session createSession(SshConf ...