Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it a good idea to use both Angular 1.x and 2.0 in the same application during migration?

There is no questioning that Angular v2.0 is on the way and TypeScript will be the writing language of choice for Angular apps (Microsoft and Google collaborating on TypeScript Language).

Because Angular 2 breaks compatibility with previous versions, for current project that use v1.x, is it a good idea to, more accurately, will it be possible to use both the legacy Angular libraries in tandem with v2.x and above?

The obvious reasons for this are that "if it's not broken, don't fix it" - not seeing the real need to go and completely re-develop all our old Angular code just to conform to v2.x. However, for all new development, use the v2.x libraries.

More succinctly, will it be possible to use both Angular 1.x and 2.x libraries in the same project and there any foreseeable pitfalls in this approach?

like image 519
ElHaix Avatar asked Dec 07 '25 09:12

ElHaix


1 Answers

Yes, it is possible. In fact the Angular team discussed this in their keynote at ng-conf. You can have an Angular 2 module within your Angular 1 or vice-versa, allowing you to incrementally update your app to Angular 2.

There are also several blog posts which provide additional information on migration strategy.

  1. Angular Team Blog - Angular Connect Recap
  2. Angular Team Blog - Angular 2 Beta Release
  3. Thoughtram.io Blog - Upgrading Apps to Angular 2
like image 185
Chic Avatar answered Dec 10 '25 01:12

Chic