Skip to content

Commit

Permalink
fix(ng1): Copy object properly. Fixes #357
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Aug 4, 2016
1 parent 2503ef2 commit 9ca38cd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ng1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ export function initAngular1(plugins) {

(function(serviceName, cls, name) {
window.angular.module('ionic.native').service(serviceName, [function() {
let funcs = {};
for (var k in cls) {
funcs[k] = cls[k];
}
funcs['name'] = name;
var funcs = window.angular.copy(cls);
funcs.prototype['name'] = name;
return funcs;
}]);
})(serviceName, cls, name);
}
}
}
}

0 comments on commit 9ca38cd

Please sign in to comment.