Open ErikGrimes opened 8 years ago
In your MainApp
class you have a property
@property
RecursiveItem item;
and assign a RecursiveModel
to item
in ready()
. How is that supposed to work?
Can you please add the source of RecursiveModel
and the Other
class?
class RecursiveModel extends Object with JsProxy {
@reflectable
Other other;
@reflectable
List<RecursiveModel> children = [];
@reflectable
RecursiveModel single;
}
class Other extends Object with JsProxy {
@reflectable
String name;
Other(this.name);
}
What about the type mismatch between RecursiveItem
vs RecursiveModel
from my last comment?
Ah...didn't see that. I changed the type to RecursiveModel, but the property binding in the child still doesn't update.
The culprit is the array binding.
item="[[arrayItem(item.children.*,0)]]"
Passing a model straight through works. The array binding works in the sense that it passes the array element down to the child element, which is why the computed binding works, but I can't seem to trigger binding updates for it, not even by setting the item.other.name property in an observer.
@reflectable
handleItemChanged(RecursiveModel newItem, oldItem){
new Future.delayed(new Duration(seconds:1),(){
set('item.other.name',newItem.other.name);
});
}
_mainapp.html
_mainapp.dart
_recursiveitem.html
_recursiveitem.dart
expected
actual