0

What can be done to upgrade NG-1 to NG-2 where the directive has "compile" in it. Eventhough in doc they say "compile. This will not be supported in Angular 2", can anybody suggest me if any cheats available?..

peaceUser
  • 457
  • 5
  • 19

1 Answers1

1

Directive in Angular2 doesn't have template metadata. So you can't think of compiling directive's template as it is not available.

Angular2 directive's have different ways to implement the things. Everything depends upon your use case how & what exactly you want.

micronyks
  • 54,797
  • 15
  • 112
  • 146
  • How can we achieve the compile in Angular2...!, my use-case is something which has to generate Widgets/Layouts from model-data. – peaceUser Sep 13 '16 at 07:02
  • I understand compile is there in angular1 for directive's template. But it is not same in angular2. Though you can check with [ngUpgrade](https://angular.io/docs/ts/latest/guide/upgrade.html) if something is there then. – micronyks Sep 13 '16 at 07:05
  • ya, since Angular2 doesn't support compile, ng-upgrade not possible, it's mentioned in the same doc under : "Using Component Directives".. – peaceUser Sep 13 '16 at 07:09
  • Yes that what I said. come up with code so somebody can help you. – micronyks Sep 13 '16 at 07:27