Removed Recipe Template as it was not needed.
Moved host listeners to the component declaration. Form submit on Return fixed.
This commit is contained in:
@@ -1,13 +1,4 @@
|
||||
import {
|
||||
computed,
|
||||
Component,
|
||||
HostListener,
|
||||
inject,
|
||||
debounced,
|
||||
input,
|
||||
linkedSignal,
|
||||
afterNextRender,
|
||||
} from '@angular/core';
|
||||
import { computed, Component, inject, debounced, input, linkedSignal, afterNextRender } from '@angular/core';
|
||||
import { form as createForm, FormField, FormRoot } from '@angular/forms/signals';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -42,6 +33,9 @@ export interface EmployeeAttendanceFormData {
|
||||
selector: 'app-employee-attendance',
|
||||
templateUrl: './employee-attendance.component.html',
|
||||
styleUrls: ['./employee-attendance.component.css'],
|
||||
host: {
|
||||
'(window:keydown.f2)': 'focusDate($event)',
|
||||
},
|
||||
imports: [
|
||||
FormField,
|
||||
FormRoot,
|
||||
@@ -101,7 +95,6 @@ export class EmployeeAttendanceComponent {
|
||||
employeesResource = this.employeeSer.autocomplete(computed(() => this.debouncedEmployeeSearch.value() ?? ''));
|
||||
employees = computed(() => this.employeesResource.value() ?? []);
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.form().focusBoundControl();
|
||||
|
||||
Reference in New Issue
Block a user