Lets say I have become comfortable with developing client-side SPA's with angular 1 but now I want to make the change to Angular 2.
Who would be some of the important paradigms to take into consideration when making the change?
Here are some questions that may help frame your answers:
Some Important Features of Angular 2 are:Modern, faster, and highly scalable framework. Equally useful framework for web, mobile, and desktop apps. Web components based architecture. Supports Hierarchical Dependency Injection.
In a hybrid application you run both versions of Angular at the same time. That means that you need at least one module each from both AngularJS and Angular. You will import UpgradeModule inside the NgModule, and then use it for bootstrapping the AngularJS module.
Angular 2 itself is built using TypeScript.
NgUpgrade is a library in Angular that allows us to upgrade our Angularjs (1.X) application to Angular gradually. It lets run Angular side-by-side along with AngularJs with breaking the application. You can install NgUpgrade using npm command npm install @angular/upgrade --save.
Main difference in architectural design is probably the unidirectional data flow and the focus on components.
Start using controllerAs
with Typescript classes as your controllers if you want a more easy transition. Start learning the basics of RxJS
, Ng2 is built on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With