Make Ember.js App Offline with Server Sync



Use the ember-localstorage adapter.

App.store = DS.Store.create({
   revision: 11,
   adapter: DS.LSAdapter.create()
});

Example

You need to define the adapter you want to use for client-side storage −

App.Store = DS.SyncStore.extend({
   revision: 10,
   adapter: DS.IndexedDB.adapter({
      mappings: {
         person: App.Person,
         persons: App.Person,
         contact: App.Contact,
         contacts: App.Contact
      }
   })
});
Updated on: 2020-06-25T07:55:53+05:30

113 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements