Please reference the attached file.
Creating an ObservableObject hierarchy yields an Object rather than an Observable for data members that start with the underscore character.
To reproduce, load the attached file, place a break point on line 31 which reads:
Observe that root1 and root2 have been created using identical techniques, except that root2 has a member who's name starts with the underscore (i.e. _root). Observe that root1 is an observable while root2 is an object. Step over this line and note that the bind to the change event fails because root2 is not an observable.
How can one build a viewmodel when some members of the object hierarchy start with an underscore?
Creating an ObservableObject hierarchy yields an Object rather than an Observable for data members that start with the underscore character.
To reproduce, load the attached file, place a break point on line 31 which reads:
var
root2 = vm2.get(
'_root'
);
Observe that root1 and root2 have been created using identical techniques, except that root2 has a member who's name starts with the underscore (i.e. _root). Observe that root1 is an observable while root2 is an object. Step over this line and note that the bind to the change event fails because root2 is not an observable.
How can one build a viewmodel when some members of the object hierarchy start with an underscore?