Skip to content

Commit 1856238

Browse files
committed
($meteorCollection.save()): Change stripDollarPrefixedKeys to angular.copy, fixes #372
still needs to add tests
1 parent 229bc33 commit 1856238

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

modules/angular-meteor-meteorCollection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ angularMeteorCollections.factory('AngularMeteorCollection', ['$q', '$meteorSubsc
3030
var deferred = $q.defer();
3131

3232
// delete $$hashkey
33-
item = $meteorUtils.stripDollarPrefixedKeys(item);
33+
item = angular.copy(item);
3434

3535
if (item._id) { // Performs an update if the _id property is set.
3636
var item_id = item._id; // Store the _id in temporary variable

modules/angular-meteor-utils.js

-11
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ angularMeteorUtils.service('$meteorUtils', [ '$timeout',
2323
// return autorun object so that it can be stopped manually
2424
return comp;
2525
};
26-
// Borrowed from angularFire - https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454
27-
this.stripDollarPrefixedKeys = function (data) {
28-
if( !angular.isObject(data) || data instanceof File) { return data; }
29-
var out = angular.isArray(data)? [] : {};
30-
angular.forEach(data, function(v,k) {
31-
if(typeof k !== 'string' || k.charAt(0) !== '$') {
32-
out[k] = self.stripDollarPrefixedKeys(v);
33-
}
34-
});
35-
return out;
36-
}
3726
}]);
3827

3928
angularMeteorUtils.run(['$rootScope', '$meteorUtils',

0 commit comments

Comments
 (0)