0
我動態創建像一些組件:Angular 2對動態創建的組件視圖進行排序?
let comFac = this.componentFactoryResolver.resolveComponentFactory(com)
let newCom: ComponentRef<any> = viewContain.createComponent(comFac)
newCom.changeDetectorRef.detectChanges()
然後我推newCom
到一個臨時數組,如:
this.comArr.push(newCom)
而且viewContain
可以顯示這些components'view correctly.Now我想動態通過拖動它們等操作對這些組件的視圖進行排序。如何使組件被拖動後顯示視圖,但不能再次創建它們(組件)?