-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component relative paths are not being respected #10614
Comments
I ran some tests with boilerplate projects from different versions of |
That being said this issue may not belong here but leaving it open until someone more informed says otherwise. |
A possible workaround would be use @Component({
moduleId: module.id,
selector: 'app-card',
template: require('./card.component.html')
.... |
Thanks @opsxcq. I've tried that work around but there's another bug that's preventing us from making publishable reusable components and that's that some of the components have static assets which get served from the root and not relative to the package ( |
Duplicate of angular/angular-cli#1624 |
Relative assets are tracked in #6637 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
I am trying to create a custom component which I install using
npm install ./package_path
. However the templateUrl is loaded relative to the root of the dev server instead of relative to the package.I have read the documentation on component relative paths on the Angular 2 Docs as well as on Thoughtram.
The component is being bundled as a commonjs module and
module.id
is added on the Component decorator.The only thought that came to mind is maybe it has something to do with the fact that
angular-cli
is using webpack and there is some disconnect between the two. However I imagine that would be a common problem and after searching issues in bothangular
andangular-cli
I'm at a loss.Expected/desired behavior
To load relatively to the package.
Please tell us about your environment:
Typescript Code
Transpiled ES5 commonJS code
Screenshot
The text was updated successfully, but these errors were encountered: