Skip to content

Commit 2341ec6

Browse files
committed
fix(find-lazy-modules): JSON parse error for loadChildren
Fixes angular#1960. cc @filipesilva @ericjim
1 parent a647e51 commit 2341ec6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

addon/ng2/models/find-lazy-modules.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export function findLoadChildren(tsFilePath: string): string[] {
3535
})
3636
// Get the full text of the initializer.
3737
.map((node: ts.PropertyAssignment) => {
38-
return JSON.parse(node.initializer.getText(source)); // tslint:disable-line
38+
let text = node.initializer.getText(source).replace(/'/g, '"');
39+
return JSON.parse(text);
3940
});
4041

4142
return nodes

0 commit comments

Comments
 (0)