Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
built in type 'injection' fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielTWalther committed Oct 13, 2017
1 parent 1c2b2f2 commit 0aceff7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/classes/MlclElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,18 @@ export class MlclElements {
} else if (di.injectables.has(typeMeta.value.name)) {
instance[key] = this.toInstance(typeMeta.value.name, data[key]);
} else {
instance[key] = data[key];
try {
// typeMeta.value.name === "Date"
// ? console.log(...data[key])
// : null;
if (typeof data[key] === "object") {
instance[key] = new typeMeta.value(...data[key]);
} else {
instance[key] = new typeMeta.value(data[key]);
}
} catch (error) {
instance[key] = data[key];
}
}
} else if (typeof instance[key] === "object" && instance[key].constructor) {
if (_.includes(this.getClasses(), instance[key].constructor.name)) {
Expand Down

0 comments on commit 0aceff7

Please sign in to comment.