【问题标题】:Error: No component factory found for [Component Name]. Did you add it to @NgModule.entryComponents?错误:未找到 [组件名称] 的组件工厂。你把它添加到@NgModule.entryComponents 了吗?
【发布时间】:2020-08-19 09:18:36
【问题描述】:

我正在尝试进行堆栈闪电战,但是当我尝试运行它时出现以下错误:

Error: No component factory found for TasksComponent. Did you add it to @NgModule.entryComponents?

这里是网址参考:Stackblitz

我做错了什么?

【问题讨论】:

标签: angular typescript routes lazy-loading angular8


【解决方案1】:

请放注解

@Component({
    selector: 'app-tasks',
    templateUrl: './tasks.component.html',
    styleUrls: ['./tasks.component.css']
})

直接在类上:

@Component({
    selector: 'app-tasks',
    templateUrl: './tasks.component.html',
    styleUrls: ['./tasks.component.css']
})
export class TasksComponent implements OnInit {

【讨论】:

  • 这是什么?我没有得到这个
猜你喜欢
  • 2018-05-06
  • 2018-01-06
  • 1970-01-01
  • 2019-11-05
  • 2019-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-25
相关资源
最近更新 更多