Z
Z
zlodiak2018-05-19 22:07:13
Angular
zlodiak, 2018-05-19 22:07:13

Why is the selected attribute not firing?

Please help me understand why the selected attribute does not always work in select fields. My form has 3 such fields, but the selected attribute worked in only one of them. Live demo here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-05-20
@zlodiak

You are setting the initial value incorrectly. We cut it out, and in the createSubForm [selected]method, instead of an array of all possible values, we pass one to the FormControl constructor. Like so .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question