I'm trying to use relative path when defining templateUrl in angular2 component, as described here: http://schwarty.com/2015/12/22/angular2-relative-paths-for-templateurl-and-styleurls/
@Component({ selector: 'login-app', moduleId: module.id, templateUrl: './app.html' })
although I keep getting:
ERROR: module is not defined
I am using --m commonjs
in TypeScripy compile settings.
How to make it work?
This simply doesn't seem to work for me. I can see in the Github repo for Angular 2 that the feature was supposedly added in early December, but it doesn't function at all best I can tell.
The docs have not been updated to reflect it, and it's still missing proper tests from what I can tell.
Update:
Here's part of what's going on. This requires a CommonJS specific feature to work, so you have to have that module system in use in your tsconfig.json file.
On top of that, there's an issue when using SystemJS because of the way it bundles everything into the root.
Basically there seem to be a lot of restrictions on being able to use this new feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With