5

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?

mvermand
  • 5,829
  • 7
  • 48
  • 74
  • *Check this http://stackoverflow.com/a/37044960/1679310* – Radim Köhler Jul 12 '16 at 15:34
  • 1
    From the commit it says "`DynamicComponentLoader` is deprecated. Use `ComponentResolver` and `ViewContainerRef` directly." https://github.com/angular/angular/commit/5297c9d9ccc6f8831d1656915e3d78e767022517 example http://plnkr.co/edit/8o9dAcOQ4LTYa4Oms5wE?p=preview – jtzero Jul 15 '16 at 16:52
  • 1
    better example: https://github.com/PulpoWork/angular2-inner-content/blob/master/src/inner-content.ts – jtzero Jul 15 '16 at 17:00

1 Answers1

3

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/

Community
  • 1
  • 1
monica
  • 1,454
  • 14
  • 28
  • ComponentResolver has also been removed. https://github.com/angular/angular/commit/73a9ee4 – Rajind Ruparathna Oct 07 '16 at 08:06
  • 1
    This answer might help you http://stackoverflow.com/questions/38888008/how-can-i-use-create-dynamic-template-to-compile-dynamic-component-with-angular – monica Oct 07 '16 at 09:26