jeudi 15 septembre 2022

Ember 4.6

Am I missing something in the following:

<select
  id=
  name=
  
>
  <option value="null">Select one ... </option>
  

  
  
  
    <option
      value=
      selected=
    ></option>
  
</select>

The selected option is not being identified when the is first loaded. The statements show that one of the records have @curVal and item.id having equal values. Using the and

typeof  get(item.id)

and the same for @curVal shows they are both strings.

I originally used ember-truth-helpers, with


but that never selects anything. So I wrote a local function:

@action
  areEqual(curval, itemId) {
    console.log('typeof curval', typeof curval);
    console.log('typeof itemId', typeof curval);
    return curval == itemId;
} 

but it never seems to be called. What am I doing wrong?




Aucun commentaire:

Enregistrer un commentaire