AngularJS simplified the way web programming was done at that time. It implemented successful design patterns from other development environments like Model View Controller (MVC) and Dependency Injection (DI).
In AngularJS, the modules are mostly dependency injection containers that group related functionality. There is currently no way to have two services with the same name but different implementations. AngularJS silently overwrites modules if they have the same name. In AngularJS, we can inject dependencies in multiple places in different ways.
It benefits for great documentation and community support.
The new Angular version is focused on the development of mobile apps because of the challenges related to mobile. (performance, load time, etc.)
Since Angular2‘s first announcement in 2014 and the final release in 14th September 2016 a lot of internal changes were done based on community feedback and what competitors achieved in the meantime.
The combination of Angular2 with TypeScript provides a big opportunity in object oriented programming in the front-end.
Also, it contributes to a great developer experience making it possible to have IDE features similar to those known from OOP world. (static compilation, code completion, etc.)
There are many conceptual and syntactical differences between AngularJS and Angular2. For example Angular2 syntax was simplified.
In AngularJS when doing one way data binding you have to be specific about the context (source of the binding) so you have to prefix the binding with the controller alias. On the other hand in Angular2 the context of the binding is implied and is always the associated component, so it needs no reference variable.
While in AngularJS, you can only specify the style sheets for your entire application, in Angular2 you have also the option to encapsulate a style sheet within a specific component so that it applies only to that specific component.
Other examples can be found here: https://angular.io/docs/ts/latest/cookbook/a1-a2-quick-reference.html
While the syntax and architecture of Angular2 applications is a lot easier to understand than AngularJS, tooling is a bit more complex. Angular CLI is a project trying to address this specific problem by making easy to start a new Angular2 project.
Angular2 is not an MVC framework, but rather a component based framework. In Angular2 an application is a tree of loosely coupled components.
Components are the basic building blocks of Angular2 applications. A component will bring together the views, styles, controller logic, and state.
Every Angular2 application has at least one module called the root module and at least one component called the root component.
Rendering performance is substantially improved in Angular2. Also the zone.js module monitors the changes in the application and makes decisions on when to update the UI of each component.
Keeping the rendering engine in a separate module allows third-party vendors to replace the default DOM renderer with one that targets non browser-based platforms. For example, this allows reusing the application code across devices, with the UI renderers for mobile devices that use native components.
Components use services for implementing business logic. A service is typically a class with a well defined purpose and usually it is injected in the component by and Angular injector.
Dependency injection in Angular2 is more powerful, and it is easy to use because the objects can be injected only via constructors. As a result, there is a lot less API to learn, and the components are much easier to test. Also it is possible to mark a dependency as optional or have instantiated different implementations of the same interface. So, it is very similar with the concepts of Spring DI.
Using Angular2 you can develop applications across all the platforms: web, mobile web or hybrid apps(via Ionic2), native mobile(via NativeScript) and native desktop (via Electron). Bootstrapping an angular app is platform specific allowing for example to load a module with Apache Cordova or NativeScript.
In contrast with AngularJS where lazy loading was difficult to achieve, Angular2 has built-in support through the framework’s router and so-called “lazy routes“.
Angular2 being optimized for mobile performance, has improved memory efficiency and fewer CPU cycles.
All these advantages were noticed and the framework has a good community interest:
Also, there are already some reported Angular2 applications: http://builtwithangular2.com/
References and more resources