Adding a feedback Service

Exercise

  1. Create a new class named Feedback in a file named feedback.ts in the shared folder and include in the class the necessary name/value pairs. You can see these in the db.json file (firstname , lastname , message)
  2. Import the class into the contact.component.ts file
  3. Create a new service named feedback in the folder src\app\services
  4. Import the class into the feedback.service.ts file
  5. Then add the service to the app.module.ts file 
  6. Complete the service!Import the Observable, the HttpClient, the baseURL and update the constructor. Add a getFeedbacks() method to fetch the data from the server. 

Solution: