templateUrl does not work for me

后端 未结 7 1690
有刺的猬
有刺的猬 2021-01-05 09:07

I use the seed structure as per angular.io get started project. Everything OK so far.

Now I wanted to change the top component to have a view from a separated file a

7条回答
  •  情深已故
    2021-01-05 09:47

    In my case i resolved this issue by adding moduleid property of component

    @Component({
        moduleId: module.id,
        selector: 'my-app',
        // templateUrl: './app/app.component.html'
        templateUrl:'app.component.html'
    })
    

    and it works as expected. And i get some idea from this url :
    https://www.youtube.com/watch?v=WAPQF_GA7Qg&feature=youtu.be

提交回复
热议问题