我正在安慰高度,当它发生变化时,我还将更改事件绑定到元素。我仍然没有在这里得到控制台输出......
我对骨干很陌生,有人纠正我的错误吗?
var Person = Backbone.Model.extend({
initialize:function(){
var getHeight = prompt('provide your height');
this.set({height:getHeight}); //i am changing the height...
this.bind('change:height',function(){
console.log(this.get('height')); //i am not getting any console here...
})
},
defaults:{
name:'new Name',
height:'unknown'
}
});
var person = new Person();