I am trying to create a select component. In which I need to select an option based on the value in object.
Found something similar here
Implemented same:
<select>
<option value="" selected disabled >Select </option>
<option value= selected=></option>
</select>
Here sourceType.id
is id
for current option and selectedOption
is sourceType reference in source object. Type is number in REST service response for both of them.
When I tried to print value of eq sourceType.id selectedOption
in option it is giving me false. Then I checked for eq
documentation, it is a === b
- Why is it giving false even if value and type both are same.
- Is there any way to just check for value like
a == b
.
Aucun commentaire:
Enregistrer un commentaire