Skip to content

Commit 7e1a808

Browse files
committed
Merge pull request #316 from Urigo/bugFix/remove-hashkey
#299 remove $$hashkey from saved items two levels down
2 parents 23533b9 + ca920ba commit 7e1a808

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/angular-meteor-meteorCollection.js

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ angularMeteorCollections.factory('AngularMeteorCollection', ['$q', '$meteorSubsc
2828
function upsertObject(item, $q) {
2929
var deferred = $q.defer();
3030

31+
// delete $$hashkey two levels down
32+
if (item.$$hashKey)
33+
delete item.$$hashKey;
34+
35+
angular.forEach(item, function(prop) {
36+
if (prop.$$hashKey)
37+
delete item.$$hashKey;
38+
});
39+
3140
if (item._id) { // Performs an update if the _id property is set.
3241
var item_id = item._id; // Store the _id in temporary variable
3342
delete item._id; // Remove the _id property so that it can be $set using update.

0 commit comments

Comments
 (0)