Angular 2 Is Easier
The new Angular codebase is more modern, more capable and easier for new programmers to learn than Angular 1.x, while also being easier for project veterans to work with.
With Angular 1, programmers had to understand the differences between Controllers, Services, Factories, Providers and other concepts that could be confusing, especially for new programmers.
Views and controllers are replaced with components, which can be described as a refined version of directives.
Even experienced Angular programmers are not always aware of all the capabilities of Angular 1.x directives.
Angular 2 components are considerably easier to read, and their API features less jargon than Angular 1.x's directives.
Additionally, to help ease the transition to Angular 2, the Angular team has added a
.component method to Angular 1.5, which has been back-ported by community member Todd Motto to v1.3.
Despite being a complete rewrite, Angular 2 has retained many of its core concepts and conventions with Angular 1.x, e.g. a streamlined, "native JS" implementation of dependency injection. This means that programmers who are already proficient with Angular will have an easier time migrating to Angular 2 than another library like React or framework like Ember.
Performance and Mobile
Angular 2 was designed for mobile from the ground up. Aside from limited processing power, mobile devices have other features and limitations that separate them from traditional computers. Touch interfaces, limited screen real estate and mobile hardware have all been considered in Angular 2.
Desktop computers will also see dramatic improvements in performance and responsiveness.
Angular 2, like React and other modern frameworks, can leverage performance gains by rendering HTML on the server or even in a web worker. Depending on application/site design this isomorphic rendering can make a user's experience feel even more instantaneous.
Project Architecture and Maintenance
The first iteration of Angular provided web programmers with a highly flexible framework for developing applications. This was a dramatic shift for many web programmers, and while that framework was helpful, it became evident that it was often too flexible. Over time, best practices evolved, and a community-driven structure was endorsed.
Some of the other interesting features in Angular 2 are:
- Form Builder
- Change Detection
- Shadow DOM
Differences Between Angular 1 & 2
Note that "Transitional Architecture" refers to a style of Angular 1 application written in a way that mimics Angular 2's component style, but with controllers and directives instead of TypeScript classes.
|Old School Angular 1.x||Angular 1.x Best Practices||Transitional Architecture||Angular 2|
|Nested scopes ("$scope", watches)||Used heavily||Avoided||Avoided||Gone|
|Directives vs controllers||Use as alternatives||Used together||Directives as components||Component directives|
|Controller and service implementation||Functions||Functions||ES6 classes||ES6 classes|
|Module system||Angular's modules||Angular's modules||ES6 modules||ES6 modules|