0.1.0 • Published 8 years ago
angular-esc v0.1.0
angular-esc
Angular 4+ Directive adding (esc) event for escape key press.
Installation
- Get it from npmjs (for npm <v5 add
--saveflag):
npm i angular-esc- Import
EscModuleinto your application:
import { EscModule } from 'angular-esc';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, EscModule],
bootstrap: [AppComponent]
})
class AppModule {}Usage
@Component({
selector: 'app',
template: `
<div *ngIf="isVisible" (esc)="isVisible = false">I will hide after Escape is pressed</div>
`
})
export class AppComponent {
public isVisible: boolean = true;
}Options
| Property name | Type | Default | Description |
|---|---|---|---|
watchEsc | boolean | true | false value will disable the watcher |
stopEscPropagation | boolean | true | By default the event is not propagated further, you can change it here. |
0.1.0
8 years ago