'Search with multiple search fields in Angular

I need to perform a search on button click based on the input from these fields where name and lastname are required

I have a form in my component.html, this formgroup in my ts file and a db.json file with dummy data

    fatherForm = new FormGroup({
    id:new FormControl(''),
    firstName: new FormControl('', Validators.required),
    nin: new FormControl(''),
    phoneNumber: new FormControl(''),
    lastName: new FormControl('', Validators.required),
    dateOfBirth: new FormControl(''),                                                                                     
    gender: new FormControl(''),

  }
)

How can i search my db.json on button click? Any idea? Thank you in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source