Update Binding when nested object property changes

Hi!

EDIT: Forgot to tell, that i am updating a nested property

When i update user properties like user.roleId from within organization-diagram, the user-list does not get notified about the update. Using a binding signaler on user-list did not work, too. What am i doing wrong, or how could i update the bound users in user-list, when a users.roleId changes?

 <user-list users.bind="organization.users"></user-list>
 <organization-diagram organization.bind="organization"> </organization-diagram >

Both elements use 2way-binding.

Thanks in advance

1 Like

I ended up with

@bindable({defaultBindingMode: bindingMode.twoWay})
  users;
  // this is purposely using dirty-checking!
  get usersWithoutRole() {
    return this.users ? this.users.filter(user => !user.roleId) : [];
  }

and

  <li repeat.for="user of usersWithoutRole | filter: searchTerm"  ...>

If someone has a cleaner way, it would make me very happy! :slight_smile:

1 Like