Angular2 Typescript app throws 404 on components when js extension not specified

前端 未结 7 1567
青春惊慌失措
青春惊慌失措 2021-02-12 09:32

I just started to play around with Angular2, and ran into a weird component file extension problem:

Let\'s use the 5 minutes quickstart demo from angular.io (I\'ll repro

7条回答
  •  半阙折子戏
    2021-02-12 10:16

    In my case, it is resolved when added module.id

    @Component({
        ***moduleId: module.id,***
        providers : [MyService],
        templateUrl: 'sandbox.component.html',
    })
    

提交回复
热议问题