Why upgrade to Angular 2
23/10/2017 4:58 PM by
Do you know why it is a good idea to upgrade your AngularJS application to the latest version of Angular?
There are number of reasons why you should consider migrating your AngularJS application to the latest version,
The most annoying feature of AngularJS 1.x is that we can’t add anything dynamically. In contrast, in Angular 2 we can create a component, configure a router and register a service in a pleasant way. One of the basic concepts of Angular 2 is that after clicking on some menu item we can dynamically pull the part of the application responsible for the application display. To do it in Angular 1 we had to hack the framework, use undocumented functions and gaps in the framework – things that we actually shouldn’t do.
Angular 2 is entirely component-based. This feature enforces thinking in components and as a result, we get an application that is neatly and naturally divided into separate parts - at least if you don’t create one component for the entire subpage. Component-based application development is usually faster due to easy creation and reasoning. Well designed components are also reusable which makes an application code more coherent.
- Dependency injection
There is a simpler, more intelligible dependency injection container in Angular 2. Few developers knew the difference between provider, service and factory in Angular 1 and there is no such problem in Angular 2. Now the default setting is class instance - only if you want to use a different raw value you need to declare it explicitly using an easily understandable object literal.
- TypeScript Support
Do you feel this rule needs an update?