在练习nativescript-angular时遇到一个bug
Error:could not resolve xxx.html
最终找到原因:
@Component({})中的文件路径不对
可能是因为版本不同,写法不同,导致找不到路径,以下有四种路径可尝试
1。app/xxx.html
@Component({
selector: "tab-view-test",
templateUrl: "app/tab.html"
})
2。要相对于浏览器的路径,从app里面的第一层 /pages/tabview/xxx.html这样的
@Component({
selector: "tab-view-test",
templateUrl: "pages/tabview/tab.html"
})
3。./xxx.html
@Component({
selector: "tab-view-test",
templateUrl: "./tab.html"
})
4。moduleId: module.id,
@Component({
selector: "tab-view-test",
moduleId: module.id,
templateUrl: "./tab.html"
})