One of the most important thing when building custom form component is adding accessbility support. The component should be focusable. we can achieve this by adding 'tabindex="0"': <div tabindex="0" > Add some css class for foucs…
About jQuery Hotkeys is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. The syntax is as follows: $(expression).bind(types.keys, handler); $(expression).unbind(ty…
We have a form component: <label> <h3>Type</h3> <workout-type formControlName="type" ></workout-type> </label> form = this.fb.group({ name: ['', Validators.required], type: 'strength' }); constructor( private…
If we want to add global event handler, we can use 'EventManager' from '@angular/platform-broswer'. Now we have a modal component, we want to click 'Esc' key to close the modal. <au-modal class="auth-modal" *auModalOpenOnClick="[loginBut…
For example, we have a component which just simply render router-outlet: import { Component } from '@angular/core'; @Component({ selector: 'mail-app', styleUrls: ['mail-app.component.scss'], template: ` <div class="mail"> <router-outlet…
This lesson shows you how set listen for click events using the (click) syntax. It also covers getting values off of an input using the #ref syntax then passing that value into the onClick event handler.…
The upload class will be used in the service layer. Notice it has a constructor for file attribute, which has a type of File. This will allows us to initialize new uploads with a JavaScript File object. You will see why this is important in the next…
New use case that is supported by the HTTP client is Progress events. To receive these events, we create our HTTP request manually in the following way: longRequest() { const request = new HttpRequest( "POST", "/api/test-request", {},…
//switch-control component import { Component } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators} from '@angular/forms'; @Component({ selector: 'switch-control', templateUrl: './switch-control.componen…
http://unixpapa.com/js/mouse.html Javascript Madness: Mouse Events Jan WolterAug 12, 2011 Note: I have stopped updating this page. At this point nearly all popular browsers are have achieved a good level of compatibility on most of these features, an…
Angular 2 separates updating the application model and reflecting the state of the model in the view into two distinct phases. The developer is responsible for updating the application model. Angular, by means of change detection, is responsible for…
Mousetrap is a simple library for handling keyboard shortcuts in Javascript. It is around 2kb minified and gzipped and 4.5kb minified, has no external dependencies, and has been tested in the following browsers: Internet Explorer 6+ Safari Firefox Ch…
Angular 4.x 快速入门 Angular 4 快速入门 涉及 Angular 简介.环境搭建.插件表达式.自定义组件.表单模块.Http 模块等 Angular 4 基础教程 涉及 Angular CLI 使用.创建组件.事件.自定义服务. ngFor 指令.Input.Output 装饰器等 Angular 4 指令快速入门 涉及如何创建指令.定义输入属性.事件处理.如何获取宿主元素属性值.如何创建结构指令等 Angular 4 表单快速入门 涉及如何创建表单.表单验证.表单控件状态.…
原文: https://medium.com/@jorgecasar/how-to-use-web-components-with-angular-41412f0bced8 ------------------------------------------------------------- I already told you about Web Components and Frameworks and now we have to put it into practice so tha…
In this tutorial, we will be exploring dojo/on and how Dojo makes it easy to connect to DOM events. We will also explore Dojo's publish/subscribe framework: dojo/topic. 在本教程中,我们将会探讨dojo/on模块,使用该模块可以更简单的关联DOM事件.我们也会探讨dojo的publish和dubcribe框架:dojo/topic…
Events Sending Native (DOM) Events anchorElement.click(); Sending Custom Events var event = document.createEvent('Event'); event.initEvent('my-custom-event', true, true); //can bubble, and is cancellable someElement.dispatchEvent(event); //modern; no…
About Events in iOS Users manipulate their iOS devices in a number of ways, such as touching the screen or shaking the device. iOS interprets when and how a user is manipulating the hardware and passes this information to your app. The more your app…
1.A type that defines an event member allows the type (or instances of the type) to notify other objects that something special has happened 2.defining an event member means that a type is offering the following capabilities: 1.A method can register…
Now that Angular 2 is in beta, the time has come for us to drop everything and learn something new, again. The good news is, like React and Angular 1.x, Angular 2 is here to stay for a while so it’s a good investment to become productive with this ne…
Using keyboard shortcuts To use a keyboard shortcut, press a modifier key at the same time as a character key. For example, pressing the Command key (it has a ⌘ symbol) and then the "c" key copies whatever is currently selected to the Clipboard.…
#### 最专业,最全面的angular的学习文档 https://www.jianshu.com/p/f0f81a63cbcb ### https://www.cnblogs.com/xiaoweihuang/p/9794478.html ##### angular的指令传参数. ##### angular中度了解. #### rxjs可以避免angular的单向数据流. angualr的编程是面向类的,只要provider注入就是一个新的对象.angular是单向数据流. #### 如果父组…
About Events in iOS Users manipulate their iOS devices in a number of ways, such as touching the screen or shaking the device. iOS interprets when and how a user is manipulating the hardware and passes this information to your app. The more your app…
/*********************************************************************************** * C# mouse keyboard monitor * 说明: * 最近想用C#做一个鼠标.键盘模拟器,所以找了点资料模拟一下. * * 2016-7-10 深圳 南山平山村 曾剑锋 ***********************************************************************…
Origianl article Protal from Angular CDK, is a way to create dynammic component. Consider an example of Page toolbar. This toolbar should  show differently content when route changed. For example, when we changed the router to 'Contacts page': There…
So when you need to create a ControlValueAccessor? When you want to use a custom component as form control. For example a counter component, you can custom the style and the way to control the value changes. It needs some setup for control value acce…
Angular常见问题:subscribe()还是 async 管道 ? 终极答案就在这里 Angular Development #10 – RouteReuseStrategy – Maintaining Component State on Navigation Angular Development #8 – Control Value Accessor Create An Angular Library And Consume it locally (with debugging) H…
组件声明周期以及angular的变化发现机制 红色方法只执行一次. 变更检测执行的绿色方法和和组件初始化阶段执行的绿色方法是一个方法. 总共9个方法. 每个钩子都是@angular/core库里定义的接口. import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-life', templateUrl: './life.component.html', styleUrls: ['./life.co…
lightning component基于事件驱动模型来处理用户界面的交互.这种事件驱动模型和js的事件驱动模型也很相似,可以简单的理解成四部分: 1.事件源:产生事件的地方,可以是页面中的输入框,按钮等等: 2.事件: 点击,失去焦点,初始化等等: 3.事件对象:当在事件源触发某个事件的时候,一般会产生一个事件对象,记录着事件的事件源相关信息以及相关的事件信息: 4.事件处理程序(Event Handler):对当前的事件进行程序的处理或者函数. 接下来回到lightning中.在lightn…
为什么使用 Angular 我不是 Angular 的布道者,但如今痴迷 Angular,使用 Angular 做项目让我有一种兴奋感.目前的三大主流前端框架都研究过,博客中也有三者的相关教程,最早接触的是 React,但是并没有实际的项目经验,只做过一些 Demo .使用 Vue 做过一个比较复杂的移动端大数据项目,技术栈采用 Framework7 + Vue + Vuex,整体效果还是满意的. 因为去年的项目几乎都是后台管理系统,所以框架用的不多,主要还是传统方式开发,后期为了改善前端开发体…
前言 项目需要使用chart.js插件,由于项目是使用angular开发,那么我第一步就是先把chart.js改造成angular组件来使用. 本项目代码都可以在github上下载:项目git地址 angular改造 1.搭建angular项目步骤省略了,可以自行查询ng官方文档 2.创建一个chart-js的组件 ng g c chart-js chart-js.component.html <div style="display: block; height: 100%"&g…