比方说:测试的属性在灰烬对象
Foo.user = Ember.Object.extend({
username:null,
name:null,
loadData:function(data){
_.each(data, function(value, key){
console.log(this.hasOwnProperty(String(key)), key, String(key));
console.log((String(key) in this));
console.log(key in this.__proto__);
console.log(_.has(this, key));
...
});
},
})
如果数据是一个对象前。 JSON
是否有任何Ember的测试方式或只是JS OO方式?
是的,它是强调...;)
你想在这里完成什么? – hvgotcodes 2012-07-25 17:58:55
只是玩烬。无论如何,在创建对象之前测试道具。 – slothy 2012-07-25 18:12:32