-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add hostlisener binding (#135)
- Loading branch information
Showing
14 changed files
with
158 additions
and
12,834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
apps/playground/src/app/getting-started/getting-started.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "@HostListener", | ||
"position": 2, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "@HostListener to bind events" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
id: host-listener | ||
title: HostListener to bind events | ||
sidebar_position: 3 | ||
--- | ||
|
||
Keyboard shortcuts can also be bind using HostListener in a component | ||
This is a quick way to add shortcut to your application | ||
|
||
Events are defined using the __shortcut__ prefix and then the shortcut | ||
You can use sequences and combinations. | ||
|
||
## Usage | ||
```typescript | ||
import {HostListener} from '@angular/core'; | ||
|
||
@HostListener("shortcut.k + t") | ||
onShortcut() { | ||
console.log("shortcut clicked!!") | ||
} | ||
``` |
Oops, something went wrong.
1f8ec42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ng-keyboard-shortcuts – ./
ng-keyboard-shortcuts-git-master-omridevk.vercel.app
ng-keyboard-shortcuts.vercel.app
ng-keyboard-shortcuts-omridevk.vercel.app