0
本当に基本的なBackbone.js機能に問題があります。バックボーン.toJSONとコンソール内の.isNewは動作しません。
window.Album = new Backbone.Model.extend({});
album = Album({title:'OK Computer', artist:'Radiohead'});
album.isNew
function() {
return this.id == null;
}
album.toJSON
function() {
return _.clone(this.attributes);
}
.isNewは、たとえば 'yes'を返します。
違いがある場合、私は宝石「バックボーン・オン・レール」を使用しています。
提案がありますか?