Hi, i want to do something like this in typescript:
class ViewModel extends kendo.data.ObservableObject {
constructor(values) {
super
(values);
super
.init(
this
);
}
get property1() {
return
super
.get(
'property1'
); }
set property1(value) {
super
.set(
'property1'
, value); }
}
and use like so
var
vm =
new
ViewModel({property1:
'default value'
});
kendo.bind($(
"#something"
), vm);
vm.property1 =
'updated value'
;
The problem i have is that in the ViewModel class, the get/set methods lead me to a stack overflow situation when the object is bound.
The call to super.get('property1') winds up calling an expression method that looks like d.property1 which winds up back in my call to the getter for property1, and around and around we go.
Any way around this? Basically, what i want is an ObservableObject that has the various bound properties expressed as get/set members that can be validated at design time, without have to use the ObservableObject's get/set methods that use the property name as an argument.
Make sense?
Any suggestions?
Thanks.
roger