From cb51bc961915267b7617c41bce6d93749a4b3a4a Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Sun, 4 Sep 2016 08:15:27 -0700 Subject: [PATCH] fix(find-lazy-modules): JSON parse error for loadChildren Fixes #1891, #1960. cc @filipesilva @ericjim --- addon/ng2/models/find-lazy-modules.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/ng2/models/find-lazy-modules.ts b/addon/ng2/models/find-lazy-modules.ts index 9b98a9079ec2..df5f6b8d3177 100644 --- a/addon/ng2/models/find-lazy-modules.ts +++ b/addon/ng2/models/find-lazy-modules.ts @@ -35,7 +35,8 @@ export function findLoadChildren(tsFilePath: string): string[] { }) // Get the full text of the initializer. .map((node: ts.PropertyAssignment) => { - return JSON.parse(node.initializer.getText(source)); // tslint:disable-line + let text = node.initializer.getText(source).replace(/'/g, '"'); + return JSON.parse(text); }); return nodes