I am trying to build a basic Polling App which has the fields as shown in the image.
Since there are fields for two inputs i want binding for each field(Option 1 & Option 2 as option1 and option2 respectively so i can reference it in the ts file.) But when I type option for the first field the second field also gets the same value & likewise for the second field. How can I set two way binding for each of the input field?
After I click on Create Poll button the console displays as: { "question": "Who will win World Cup?", "option1": "Germany", "option2": "Germany" }
Use your index:
[(ngModel)]="options[i]"
and create an option array in the component