Image for post: Angular 2 pros and cons

Angular 2 pros and cons

To learn and work with the popular Angular 2 cannot be simple and we must take our time before starting to create amazing web applications in the real world. The only way is to practice and work with all concepts of this framework. But let's see the pros and cons about using this amazing technology:

PROS

  • You can choose from different seeds and boilerplates: Angular CLI, Angular NgCLI, Angular seed.
  • Great performances. Angular 2 has even much better performance than Angular 1. It doesn't do deep object comparison. If items are added/removed to/from an array, change detection won't detect it. The same for object properties as long as they are not directly bound from the view.
  • Directives as the Way to Add Functionality
  • Flexible when using Filters
  • In-place DOM manipulations
  • Relevant Service Providers
  • Prepared Unit Testing. Angular 2 possesses easier APIs, lazy loading, simpler/faster debugging.
  • Angular 2 is much more testable then Angular 1.
  • Support for web components. Rather than having a closed system for modularising AngularJS applications, Angular 2’s foundations lie on the emerging Web Components standard. What this means is that AngularJS will be able to use directly, without any wrapper coding, any component written as a Web Component.
  • Angular2 CLI. The Angular2 CLI makes it easy to create an application that already works, right out of the box. It already follows our best practices!
  • Deployment: you can build you app and deploy on a linux hosting for example.To have NodeJS on your server can be great but it's not necessary to release your final app
  • Angular 2 provides nested components
  • Angular 2 makes it possible to execute more than 2 systems together

Typescript:

  • It is an improved set of JavaScript.
  • Perfect support for inheritance and interfaces allows achieving higher OOP experience to JavaScript, which results into the improved code decoupling and reuse.
  • The syntax is usually more convenient for C# or Java developers.
  • AngularJs development company did not have the same opportunities as Angular 2 teams have today. By choosing Angular 2 with its Typescript, you will benefit from its model and tools to get the best experience.
  • It is fair to admit, however, few of the Typecript’s cons.

CONS

  • Difficulty in learning. If you haven't used typescript before, you'll need to learn it and spend time for it.
  • Some concepts like data binding are not so easy to understand and you can find a lot of difficulties working with a real world application
  • Regular DOM. Angular manipulates actual DOM directly, which makes it quite slower and un-efficient in comparison with React.
  • Difficulties in the server templating Angular 2 still maintains physical separation between the JavaScript driving your application, and the HTML being rendered.
  • Ng-include is not possible! This is terrible: you cannot have partial views and you are forced to create a new component to include on your view. You can use the Viewchild directive but it's not the same thing. Creating a new component means to create a new class to maintain and it's not a good solution from many point of views.
  • Confusion There are multiple ways to do the same thing with AngularJS. Sometimes, it can be hard for novices to say which way is better for a task. Hence, it is imperative for programmers to develop an understanding of the various components and how they help.
  • Lagging UI If there are more than 2000 watchers, it can get the UI to severely lag. This means that the possible complexity of Angular Forms is limited. This includes big data grids and lists.
  • Name Clashes With AngularJS, you don’t have the ability to compose many NG-apps on the same page. This can cause name clashes.
  • Testing is difficult. End to end tests are simplified only with boilerplates projects like Angular CLI.

CONCLUSIONS

Angular 2 is great to build frontend applications. If you are building a new app from scratch you can use it and deploy your app even if you don't have NodeJS on your server,
Angular 2 is not easy to learn and working with its templating system is complex because there is not an easy way to include views with their variables without creating a new component.