问题描述
更新:以下是plnkr来说明问题
UPDATE: Here is a plnkr to illustrate the problemhttp://plnkr.co/edit/bwQL3o?p=preview
Breeze生成 tempKey: EmployeeId:-1 并填充 EmployeeId:-1 的> tempKeys 数组。每件事都是好事。
Breeze generates a tempKey: EmployeeId: -1 and populates a tempKeys array with the EmployeeId: -1. Every thing is all good and great.
因此Breeze加载存储的数据时会看到 EmployeeId:-1 的 TempKeys 并生成一个新的 EmployeeId:-2
一切仍然美好。
So Breeze loads the stored data sees the TempKeys of EmployeeId: -1 and generates a new EmployeeId: -2Every thing is still good and great.
- 将新数据集存储在本地存储中时, tempKeys
数组仅包含 EmployeeId:-2 条目。 - 稍后,当您导入存储的数据时,尝试创建一个新雇员,您会得到
的错误:
- When you store this new data set in the localstorage the tempKeysarray only contains the EmployeeId: -2 entry.
- Later on, when you import the stored data and try to create a new Employee you getan Error:
问题
Breeze为什么不跟踪当前的TempKey?这是错误吗?我们如何解决此方案?任何帮助将不胜感激。
The question
Why is Breeze not keeping track of the current TempKeys? Is this a Bug? How do we fix this Scenario ? Any help would be greatly appreciated.
推荐答案
好吧,这是一个错误,现已在breeze.js存储库中进行了修复。 GitHub。此修复程序还将在Breeze.js的下一个完整版本中发布(可能在下周的某个时候)。 …并感谢您找到此文件并提供了插件。
Ok, this was a bug and has now been fixed in the breeze.js repo on GitHub. This fix will also go out on the next full release of Breeze.js ( probably sometime next week). ... and thanks for finding this and providing the plunkr.
这篇关于微风离线模式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!