mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 04:43:03 -05:00
refactor: add typing and remove deprecated keycode method
This commit is contained in:
@@ -59,8 +59,8 @@ export class PersonListComponent {
|
|||||||
|
|
||||||
label = '';
|
label = '';
|
||||||
|
|
||||||
handleKey(event: any) {
|
handleKey(event: KeyboardEvent) {
|
||||||
if (event.keyCode === 13) {
|
if (event.key === 'Enter') {
|
||||||
this.names?.unshift(this.label);
|
this.names?.unshift(this.label);
|
||||||
this.label = '';
|
this.label = '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user