Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coding against Angular 1, for easiest upgrade to Angular 2?

I'm starting a new greenfield development for an app (actually an Ionic app) that is not expected to be deployed for a while, but for a variety of reasons I cannot yet use Angular 2.

For the time being, I'll be writing in TypeScript generating ES2015, passing through Babel to convert to ES5, and writing against Angular 1.

I'd like to easily upgrade in the future to Angular 2. What are the best practices for my code to ensure as easy an upgrade path as possible to ng2?

like image 838
David Pfeffer Avatar asked Mar 14 '23 16:03

David Pfeffer


1 Answers

The simplest would be to dive into ng-forward, the offical default solution for those that want to write Angular 2.x style code in Angular 1.x.

Then later when you want to migrate to Angular 2, introduce ng-upgrade.

It should be a lot easier to use ng-upgrade if you follow the development practices since the beginning of ng-forward.

like image 142
Angular University Avatar answered Mar 16 '23 08:03

Angular University