简体   繁体   中英

Angular 2 sorting the components' views that were dynamically created?

I dynamically create some components like:

let comFac = this.componentFactoryResolver.resolveComponentFactory(com)
let newCom: ComponentRef<any> = viewContain.createComponent(comFac)
newCom.changeDetectorRef.detectChanges()

Then I push the newCom into a temp array like:

this.comArr.push(newCom) 

And the viewContain can show these components'view correctly.Now I want to dynamically sort these components' view by some operations like drag them.How to make the viewContain can show the view after components were dragged but not create them(components) again?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM