Chapter 2. Refactoring for Angular

Although the focus of this publication is on Angular applications, there are refactoring opportunities that will ease the migration from AngularJS to Angular.

Angular is a significant departure from AngularJS, entailing changes much deeper than an increase in the version number indicates. Angular is a completely different code base from AngularJS. There is no simple migration path for an AngularJS application to move to Angular.

The JavaScript language has changed significantly since AngularJS was first conceived. These changes make it easier for libraries like Angular to offload responsibilities to core language features. Innovations in JavaScript have also made it easier for Java and C# developers to transfer existing knowledge to the development of web applications.

There is no need for a developer to learn AngularJS before starting Angular. Indeed, there are so many differences that it might be better for developers to avoid learning AngularJS concepts altogether. But for developers with a background in Angular, there are changes to AngularJS and later that ease bridging the gap between the two versions.

Overview of Changes Between AnguarJS and Angular

Angular is written in Microsoft’s TypeScript language. TypeScript is a superset of JavaScript that adds static type analysis, features from object-oriented languages like interfaces and generic types, ES2015 features, and experimental JavaScript features like decorators.

TypeScript makes it ...

Get Refactoring Angular Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.