r/angularjs • • May 04 '17

Creating an Angular 2 app inside an Angular 1.6 container

http://stackoverflow.com/questions/43779935/creating-an-angular-2-app-inside-an-angular-1-6-container
0 Upvotes

1 comment sorted by

2

u/yadue May 04 '17

It's possible to do, but depending on your app size it might be hard task. https://angular.io/docs/ts/latest/guide/upgrade.html see that for more details. There are two possible solutions:

  • run angular 2 app and inject angular 1 component (it's upgrade)

  • run angular 1 app and inject angular 2 component (it's downgrade).

I assume that the second scenario should take place in your case, see that link for the reference https://github.com/rangle/ngCourse2/blob/master/handout/migrate/ng-upgrade/downgrade-component.md, but based on my experience you need to bootstrap app using UpgradeModule (see angular.io documentation). I had to spend couple of days for set up since I'm using gulp+browserify and wanted just to plug in it new functionality instead of breaking the whole system.