Closed
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussiontype: bug/fix
Description
Hi guys,
I'm having some issues with the template, not sure is related to the way how angular-cli load the dependency.
Architecture:
- Angular 2 app generated with angular-cli
- Angular 2 Component linked with npm int the generated app (test-component).
Description:
The generated Angular 2 app throw me the following error when I try to use the linked Angular 2 component :
VM32836:388 Unhandled Promise rejection: Failed to load test.component.html ; Zone: <root> ; Task: Promise.then ; Value: Failed to load test.component.html
.ts of the linked component
@Component({
selector: 'test-component',
templateUrl: './test.component.html',
styleUrls: ['./test.component.css']
})
export class TestComponent { }
If I change the code in the following way it works:
@Component({
selector: 'test-component',
template: require('./test.component.html'),
styles: [require('./test.component.css')]
})
export class TestComponent { }
But I can't use the require and I would like to fix the problem without introducing this change.
OS
Mac OSX
Versions.
angular-cli: 1.0.0-beta.20-4
node: 6.2.2
os: darwin x64
Metadata
Metadata
Assignees
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussiontype: bug/fix
Activity
filipesilva commentedon Dec 29, 2016
This seems to be an odd interaction with symlinks. Your usage is kind of peculiar though, I don't expect that to be a common case.
serhiisol commentedon Jan 12, 2017
@filipesilva I have similar problem with latest cli.
I have
ng-componentspackage which has a lot of different components, e.g.:I import it from node_modules like:
import {TooltipComponent} from 'ng-components/tooltip';Angular cli 21 used ````angular2-template-loader``` to replace template url and style urls to template with require.
So at this point it seems like it's impossible to write 3rd party components for reusability with latest cli, of course If they won't have inline html and css, which is quite ugly.
filipesilva commentedon Feb 13, 2017
Dupe of #1624
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.