我有通知使用Backbone.js&Underscore,如何獲取模型中的物品數量?
// MODEL
NotificationModel = App.BB.Model.extend({
defaults : {}
});
// COLLECTION
NotificationCollection = App.BB.Collection.extend({
model: NotificationModel,
url: '/notifications',
initialize : function() {
var me = this;
me.fetch();
}
});
收集從服務器獲取正確的一個通知模型,並具有以下字段(ID,讀),而讀是真還是假。
如何獲取讀取的項目總數== false? ...未讀項目數量?
感謝