Angular 2 rc4: DynamicComponentLoader deprecated

2020-02-14 04:44发布

问题:

I am upgrading my Angular 2 application for beta.14 to rc.4.

I get a deprecated warning on DynamicComponentLoader in @angular/core.

What is the new Class to be used? Are there any examples available?

回答1:

It has been deprecated. Instead ComponentResolver is used. Refer the first answer in this link Angular 2 dynamic tabs with user-click chosen components.

Refer this too : http://blog.lacolaco.net/post/dynamic-component-creation-in-angular-2/