fix(ng1): Copy object properly. Fixes #357
This commit is contained in:
parent
2503ef2ee5
commit
9ca38cd8a1
@ -15,11 +15,8 @@ export function initAngular1(plugins) {
|
|||||||
|
|
||||||
(function(serviceName, cls, name) {
|
(function(serviceName, cls, name) {
|
||||||
window.angular.module('ionic.native').service(serviceName, [function() {
|
window.angular.module('ionic.native').service(serviceName, [function() {
|
||||||
let funcs = {};
|
var funcs = window.angular.copy(cls);
|
||||||
for (var k in cls) {
|
funcs.prototype['name'] = name;
|
||||||
funcs[k] = cls[k];
|
|
||||||
}
|
|
||||||
funcs['name'] = name;
|
|
||||||
return funcs;
|
return funcs;
|
||||||
}]);
|
}]);
|
||||||
})(serviceName, cls, name);
|
})(serviceName, cls, name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user