Skip to content

Missing template .html file for node_modules dependency #3274

Closed
@magemello

Description

@magemello

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

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussiontype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions