How can I bind a keyevent listener on the document instead of an specific inputfield in Angular 2 using RC5?
For example:
I Know this "bind it to an element"
<input (keypress)="onKeyDown($event)" [(ngModel)]="something" type="text">
How can I bind it to the document for example
<div (keypress)="onKeyDown($event)"> <input /> ... </div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…