HostResourceResolver中的错误:无法以角度解析

时间:2020-05-16 08:12:10

标签: angular resources host resolver

我正在学习Angular。我的路线有错误

ERROR in HostResourceResolver: could not resolve ./app/detail-pokemon.component.html in context of //pokemon-app/pokemon-app/src/app/detail-pokemon.component.ts)

你能帮我吗?

thx

3 个答案:

答案 0 :(得分:0)

就我而言,我没有提供templateUrl

@Component({
  selector: 'whoami',
  templateUrl: ""
})
export class AppComponent { }

提供有效的模板网址后,它对我有用

答案 1 :(得分:0)

就我而言,我使用CLI创建了一个带有附加组件后缀的组件(导致双重命名),然后将其重命名(我在templateUrl中将其从login-component.component.html更改为login-component.html,而不是{{ 1}})

答案 2 :(得分:0)

在我的例子中,我有 templateUrl 和实际文件名不同的大写和非大写字符。

文件名为 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <ul></ul>

TemplateUrl 为 detailContent.component.html