mohamad rabee
mohamad rabee

Reputation: 587

mark all inputs as a required not working with ngFor

I want all inputs to be required and enable the button just if the user fill all the inputs. but now when the user fill just the first one the button enabled.

here is the Plunker

required inputs

Thanks a lot.

Upvotes: 1

Views: 363

Answers (1)

Julia Passynkova
Julia Passynkova

Reputation: 17879

You need to have unique names for each input.

change

 <input type="text" name="options" ngModel required>

to:

   <input type="text" [name]="element" ngModel required>

Upvotes: 1

Related Questions