So, I have a list of all users that fills in the selection options.
<option repeat.for="user of userService.users"> ${user.firstName} ${user.lastName} </option>
And I have an incoming group entry that has a list of users connected to it. I follow the cheat sheat instructions and bind them to the same model index.
<select value.bind="group.users[0]"> <option repeat.for="user of userService.users" model.bind="user"> ${user.firstName} ${user.lastName} </option> </select>
So, the incoming user in the group is identical to the incoming user in the list:
{ id: 123, firstName: 'Matt', lastName: 'Davis' }
But when the group is loaded and attached to the view, the correct user is not selected from the selected one. Actually, I would expect this, since JavaScript would look for referential equality.
Ideally, I would like Aurelia to find that the incoming record is the same as above, and (a) search the list of equality checking options (b) that I defined in some extension (maybe in a filter?), ( c) select it from the list and (d) propagate this selection back to the record so that the record is now essentially synchronized.
I would prefer not to return to a trigger that manually does this because I will have many, many such options throughout the application.
I would agree, albeit sadly, for (a) and (c).
javascript aurelia aurelia-binding
Matthew James Davis
source share