Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thinking in Angular 2 when coming from an Angular 1 background

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:

  • What is the main difference in the architectural design of Angular 2 compared to 1?
  • What should I stop/start doing?
like image 438
AnonDCX Avatar asked Apr 11 '16 08:04

AnonDCX


People also ask

What are the new features of angular 2?

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.

Can I use AngularJS and Angular together?

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.

Which language is used in angular 2?

Angular 2 itself is built using TypeScript.

What is NgUpgrade in Angular?

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.


1 Answers

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.

like image 99
Luka Jacobowitz Avatar answered Sep 20 '22 01:09

Luka Jacobowitz