比方說:測試的屬性在灰燼對象
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