I have a can.Map
hierarchy define as follows:
var Model = can.Map.extend({
define: {
value: {
value: false
},
theValue: {
get: function(){
return this.attr('value');
}
}
}
})
var ExtendedModel = Model.extend({
define: {
anotherValue: {
value: true
},
extendedTheValue: {
get: function(){
return this.attr('value');
}
}
},
toggleValue: function(){
this.attr('value', !this.attr('value'));
}
})
However, the theValue
method is never called but the extendedTheValue
method is called. Seems as though the theValue
get is not inherited. I did read something about the define
inheritance somewhere but I do not know if this is related.
Example in this jsbin.
Any way to get this working as expected?