Closed PetarRing closed 7 years ago
The select box I have, won't change the selected option.
My first attempt was: [selected]="category.value == user.userCategory.value""
[selected]="category.value == user.userCategory.value""
but it doesn't work.
I tried removing the <option value="" disabled selected>Choose your option</option> too but neither did it work.
<option value="" disabled selected>Choose your option</option>
`
<option *ngFor="let category of userCategories" [value]="category.value" [selected]="category.value == user.userCategory.value">{{category.name}}</option> </select> <label>User category</label> </div>`
Here seen as a picture:
The select-box works besides this, but when I try to initially select an option based on a user that should be edited, it won't change to category the user has.
[SOLVED]
changed line: [value]="option.value" to [value]="option"
[value]="option.value"
[value]="option"
The select box I have, won't change the selected option.
My first attempt was:
[selected]="category.value == user.userCategory.value""
but it doesn't work.
I tried removing the
<option value="" disabled selected>Choose your option</option>
too but neither did it work.`
Here seen as a picture:
The select-box works besides this, but when I try to initially select an option based on a user that should be edited, it won't change to category the user has.
[SOLVED]
changed line:
[value]="option.value"
to[value]="option"