Book
Submodule 23.1: Prepration
Submodule 23.1: Prepration
Completion requirements
View
Adding a feedback Service
Exercise
- Create a new
class named Feedback
in afile named feedback.ts
in theshared folder
and 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.ts
file - Create a new service named
feedback
in the foldersrc\app\services
- Import the class into the
feedback.service.ts
file - Then add the service to the
app.module.ts
file - Complete the service!Import the
Observable
, theHttpClient
, thebaseURL
and update the constructor. Add agetFeedbacks()
method to fetch the data from the server.