brandonroberts / angular-router-loader

A Webpack loader that enables string-based module loading with the Angular Router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work with target es2015

andreialecu opened this issue · comments

When the target is set to es2015 in tsconfig.json, the js fails to execute in the browser because of:

angular/angular#19978

The error is Uncaught TypeError: Cannot convert undefined or null to object.

The workaround is to not generate arrow functions here:
https://github.com/brandonroberts/angular-router-loader/blob/master/src/utils.js#L47

Replacing the generated code to use function() { } instead of () => { } will work around this.

Would you accept a PR for this change?

Published as 0.8.2