Permalink
Browse files

Try to cleanup the data munging

  • Loading branch information...
1 parent f589f3a commit 5c89a6724b86a2689275ef94afbe04d447d864c9 @bobtfish bobtfish committed Mar 29, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/js/controllers.js
View
@@ -3,8 +3,12 @@
/* Controllers */
function cleanData(data) {
- var jsonStringWithoutEvilAtSigns = angular.toJson(data).replace(/@/g, "")
- return angular.fromJson(jsonStringWithoutEvilAtSigns);
+ var out = {}
+ Object.keys(data).forEach(function(key) {
+ var newKey = key.replace(/@/g, "");
+ out[newKey] = data[key];
+ });
+ return out;
}
function ReportListCtrl($scope, $http) {

0 comments on commit 5c89a67

Please sign in to comment.