What are angular 2.0 Improvements
- Improved Performance
- Aligned with ES6
- Using Web Standards like web components
- No digest cycle which boosts performance
- New component router
- It will use ES6 modules and not traditional custom angular specific modules
- Asynchronous module loading, prior versions on angular app had to download entire app on bootstrap. Now if we route to a different section in app, we should be able to load modules asynchronously on the fly.
- No more scope
- Directive adds behavior to the existing DOM element.
- Following are the building blocks for Angular 2.0 app which is kind of similar to that earlier angular minus the web components
- Services have changed a bit in angular, in prior angular versions we have various flavors of angular services like
All these types are gone in angular 2.0 there is only a class in angular 2.0. What are Angular 2.0 service classes
These are classes which usually encapsulate a logic which is not related to a view.
- Service Classes are classes which encapsultes non user interface related logic like logging, making http calls configurations
- It provides something of value
- Shared data or logic
- Improved DI (Dependency Injection) – You can specify service dependencies through provider keyword in components.