2016-10-03 104 views
1

我试图导入 “ComponentResolver”错误与组件进口ComponentResolver(角2)

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

而且我有错误:

Module '"/home/maksym/untill/trunk/unTill.Modern/Code/AppRc6/node_modules/@angular/core/index"' has no exported member '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", 

我如何解决这个问题?

回答

3

由于RC.6 2.0.0-rc.6 ComponentResolver已被删除。

每angular2的changelog

使用ComponentFactoryResolver@NgModule.entryComponentsANALYZE_FOR_ENTRY_COMPONENTS提供商动态组件创建在一起。

+0

你使用entryComponents的例子吗? –

+0

看到这个答案的第一个选项http://stackoverflow.com/questions/39678963/load-existing-components-dynamically-angular-2-final-release/39680765#39680765 – yurzui

+0

谢谢,你真的帮了我! –