如何在有服务器同步可用的情况下让 Ember.js 应用程序变为离线状态?
使用 ember-localstorage 适配器。
App.store = DS.Store.create({
revision: 11,
adapter: DS.LSAdapter.create()
});示例
你需要定义要用于客户端存储的适配器 −
App.Store = DS.SyncStore.extend({
revision: 10,
adapter: DS.IndexedDB.adapter({
mappings: {
person: App.Person,
persons: App.Person,
contact: App.Contact,
contacts: App.Contact
}
})
});
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 语言编程
C++
C#
MongoDB
MySQL
JavaScript
PHP