【问题标题】:ERROR in HostResourceResolver: could not resolve in angularHostResourceResolver 中的错误:无法以角度解析
【发布时间】:2020-09-02 03:17:25
【问题描述】:

我正在学习 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)

你能帮帮我吗?

谢谢

【问题讨论】:

    标签: angular resources host resolver


    【解决方案1】:

    就我而言,我没有提供templateUrl

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

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        【解决方案3】:

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

        文件名为detailContent.component.html

        TemplateUrl 是 detailcontent.component.html

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2019-01-13
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-03-25
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多