0
RC5之前,我加載組件動態是這樣的:動態組件加載參數
System.import('path/to/MyComponent')
.then(fileContents => fileContents['MyComponent'])
.then(component => {
this.dynamicComponentLoader.loadNextToLocation(component, ..)
.then(() => {
...
});
});
由於RC5因爲DynamicComponentLoader
已被棄用,這並不工作。問題是它的前身ComponentFactoryResolver
需要一個類型作爲參數。我需要一種使用字符串名稱加載組件的方法。我怎樣才能做到這一點?