Add task in service
- ✔️Create a function in the Task ServiceCreate a function which add a new task to the TaskService based on the task object passed as a parameter.
Add a method to add a task
The TaskService will be responsible for managing the tasks list as planned. Let’s add a function to add a task to the list.
🎓 Instructions
-
Update the
src/app/task.service.ts
file.
This new function will be called from the TaskFormComponent to add a new task to the list.
✔️ What you learned
You created a function in the TaskService to isolate the Task logic inside the service.