Skip to content

Commit f8104c5

Browse files
committed
fix _parseObject() that got broken because of angular/angular.js#6253
1 parent 9d13ed9 commit f8104c5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

angularfire.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -765,23 +765,24 @@
765765
// Parse a local model, removing all properties beginning with "$" and
766766
// converting $priority to ".priority".
767767
_parseObject: function(obj) {
768-
function _findReplacePriority(item) {
768+
function _handleSpecialKeys(item) {
769769
for (var prop in item) {
770770
if (item.hasOwnProperty(prop)) {
771771
if (prop == "$priority") {
772772
item[".priority"] = item.$priority;
773773
delete item.$priority;
774+
} else if (prop[0] == "$") {
775+
delete item[prop];
774776
} else if (typeof item[prop] == "object") {
775-
_findReplacePriority(item[prop]);
777+
_handleSpecialKeys(item[prop]);
776778
}
777779
}
778780
}
779781
return item;
780782
}
781783

782-
// We use toJson/fromJson to remove $$hashKey and others. Can be replaced
783-
// by angular.copy, but only for later versions of AngularJS.
784-
var newObj = _findReplacePriority(angular.copy(obj));
784+
// We use toJson/fromJson to handle special cases, such as Date
785+
var newObj = _handleSpecialKeys(angular.copy(obj));
785786
return angular.fromJson(angular.toJson(newObj));
786787
}
787788
};

angularfire.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)