Book
Submodule 23.1: Prepration
Submodule 23.1: Prepration
Completion requirements
View
Adding a feedback Service
Exercise
- Create a new
class named Feedbackin afile named feedback.tsin theshared folderand include in the class the necessary name/value pairs. You can see these in the db.json file (firstname , lastname , message) - Import the class into the
contact.component.tsfile - Create a new service named
feedbackin the foldersrc\app\services - Import the class into the
feedback.service.tsfile - Then add the service to the
app.module.tsfile - Complete the service!Import the
Observable, theHttpClient, thebaseURLand update the constructor. Add agetFeedbacks()method to fetch the data from the server.