Html 如何在可用时通过服务器同步使 Angular.js 应用脱机
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15005419/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to make an Angular.js app offline with server sync when available
提问by Orlando
I'm looking for an approach or a library that handles this. the idea is to store data in localstorage and sync to the backend when a connection is available, http://pouchdb.com/looks like a cool solution but anyone has use it on production?
我正在寻找处理此问题的方法或库。这个想法是将数据存储在 localstorage 中并在连接可用时同步到后端,http://pouchdb.com/看起来是一个很酷的解决方案,但有人在生产中使用过它吗?
UPDATE:
更新:
Right now you can also use:
现在您还可以使用:
采纳答案by Mark Nadig
Haven't used it yet, but familiar w/ the concepts behind BreezeJS from their other offerings in .NET. Check it out http://www.breezejs.com/and here's Ward Bell presenting it to the Googlers http://www.youtube.com/watch?v=P2ErSQj3SN8&feature=player_profilepage
尚未使用它,但熟悉 BreezeJS 背后的概念,来自他们在 .NET 中的其他产品。查看http://www.breezejs.com/,这是 Ward Bell 向 Google 员工展示的 http://www.youtube.com/watch?v=P2ErSQj3SN8&feature=player_profilepage
回答by Gabor Dolla
you can also take a look at jaydata http://jaydata.org/blog/synchronized-online-offline-data-applications-part-2-syncing-large-tables-and-tables-with-foreign-relations
你也可以看看 jaydata http://jaydata.org/blog/synchronized-online-offline-data-applications-part-2-syncing-large-tables-and-tables-with-foreign-relations
回答by Amin Rahimi
breezejs is not a sync solution! if server data changes what happen in local data if some recordes deleted on server after last update local data must sync after a method called sync in other word some date must come back to client after calling savechange that tell client db to be sync with server
Brevetjs 不是同步解决方案!如果服务器数据更改了本地数据中会发生什么 如果上次更新后在服务器上删除了某些记录 本地数据必须在称为同步的方法之后同步 换句话说,某些日期必须在调用 savechange 后返回到客户端,告诉客户端数据库与服务器同步