Challenge: Use Service

Challenge your learning on the concepts of adding and using services.

Problem statement

Currently, the options for a user’s dietary preferences exist within SignupComponent as a hard-coded array. Without breaking any tests, see if you can move these diet preferences into a reusable service and update its corresponding test file to reflect your changes.


Below is the updated code. The template for service dietary-preferences has already been added. Modify it to implement the functionality mentioned in the problem statement.

Get hands-on with 1200+ tech skills courses.