AngularJS vs. Angular
AngularJS and Angular are philosophically different.
Angular 1 is at heart a DOM compiler. We write HTML, and the Angular compiler takes care of compiling it into a web application. It was a tidy little thing, and very small.
If we wanted extra behaviour, we extended the compiler by adding more directives which could be shared and reused.
The template drives our app. The HTML is our wiring.
Anyone with simple HTML skills can create a simple web application. It’s an exercise in democracy, an attempt to make plain HTML do more.
Angular 1 gets bigger
Over time Angular 1 was used to create larger and larger applications. We started arranging our code into components. We repurposed directives to make them serve as web components, then used isolate scope to separate them one from another.
This humble, elegant, beautiful DOM compiler was twisted and repurposed into something it was never meant to be, and this was bad.
Enter Angular 2. AngularJS had started as one thing and been slowly warped into something else, and this process had left it super messy. Angular 2 was a full rebuild, a whole new syntax, a new language (Typescript), a whole new codebase, built from the ground up.
Angular 2 is the logical endpoint of the transformation towards components. It is no longer a DOM compiler. Instead, it’s a component driven architecture, plus all the additional parts you might ever need to build an app.
We create a tree of components. A root component (typically the app) contains child components (e.g. a header, sidebar, list of cats, etc.)
The HTML is no longer in the driving seat. In fact our HTML page may be almost blank. All the templates belong in the components.
AngularJS attempted to democratise web application development, allowing anyone with simple HTML skills to build a web application at the cost of a complex core. Conversely, Angular 2 puts the power back into the hands of the coder, with the application of hardcore design patterns and rigour that will be beyond most HTML designers.
Both are acceptable approaches. I half wish they could co-exist under separate names.
Angular 2 is the successor of AngularJS, but it is not an iterative change. It is a philosophical groundswell. A new way of doing things.
Onwards and upwards.