在组件中导入ComponentResolver时出错(Angular 2)

时间:2016-10-03 10:44:44

标签: angular dependency-injection

我正在尝试导入“ComponentResolver”

import { Component, HostListener, ViewContainerRef, ViewChild, ComponentResolver } from '@angular/core';

我有错误:

  

模块'“/ home / maksym / untill / strunk / unTill.Modern / Code / AppRc6 / node_modules / @ angular / core / index”'没有导出成员'ComponentResolver'。

我的依赖项:

"@angular/common": "~2.0.1",
"@angular/compiler": "~2.0.1",
"@angular/core": "~2.0.1",
"@angular/forms": "~2.0.1",
"@angular/http": "~2.0.1",
"@angular/platform-browser": "~2.0.1",
"@angular/platform-browser-dynamic": "~2.0.1",
"@angular/router": "~3.0.1",
"@angular/upgrade": "~2.0.1",

我如何解决此问题?

1 个答案:

答案 0 :(得分:3)

自RC.6 2.0.0-rc.6 ComponentResolver被删除。

每个angular2更改日志

ComponentFactoryResolver@NgModule.entryComponents提供程序一起使用ANALYZE_FOR_ENTRY_COMPONENTS进行动态组件创建。