1

I want to load components dynamically which means I don't know which component to load during compile time. I have read about DynamicComponentLoader here but the angular2 Api docs says this class is deprecated, so what is the current/correct way to do this?

Finkes
  • 496
  • 5
  • 16
  • 1
    See this Günter's answer http://stackoverflow.com/questions/36325212/angular-2-dynamic-tabs-with-user-click-chosen-components/36325468#36325468 and also his topic in documentation http://stackoverflow.com/documentation/angular2/831/dynamically-add-components-using-viewcontainerref-createcomponent/2813/a-wrapper-component-that-adds-dynamic-components-declaratively#t=201607240546278053969 – yurzui Jul 24 '16 at 05:46

1 Answers1

1

Use ComponentResolver and ViewContainerRef as a replacement for DynamicComponentLoader

null canvas
  • 10,201
  • 2
  • 15
  • 18