How to create Optimised dynamic form in Angular

Viewed 28

I am creating a form in angular where I ask the user a couple of questions. I have a pool of many questions and I want to show the next question based on the answer of previous question. So say if user choose 'A' then I will ask user his fav color and if the user had selected 'B' then I would ask the user his fav food.

What's the best way to achieve this in angular. Currently I am using ngIF else and hardcoding all the questions. Is there a better way to achieve this?

0 Answers
Related