Sharing Top Content from the Angular-sphere.

Top Common Mistakes of Angular Developers – Hacker Noon

  • One of its strengths is that it allows us to decouple the application code from the renderer, which in turn makes it possible to write applications that can be executed in the browser, on the server, or even as native apps.
  • The decoupling also gives us more abilities like using AOT (ahead of time compilation) or web workers.
  • One of them is not to mutate the DOM directly using jQuery, document object or the dom directly — the bad wayAs you can see, the doBadThings method has three lines of code, which demonstrate three ways to mutate the DOM directly.
  • The Angular way to mutate the DOM is via the Renderer2 service (in v4, Renderer in v2).
  • Mutate the dom via Renderer — the recommended wayIn this way, we call the setElementProperty of the renderer with three arguments.

In this article, we will cover the top common mistakes, and we will understand how to fix them. Each of those can be an idea to a full article. We will cover them briefly but in an exhaustive manner.

Angular is a new platform. We learn how to use it, how to optimize the application and how to improve our code. As part of being team members, we do code reviews and trying to improve each other skills. As part of the code reviews and reading of code examples on the web, I pay attention to some common mistakes of Angular developers. It can be a junior or an expert developer, we all make mistakes in the code.

In this article, we will cover the top common mistakes, and we will understand how to fix them. Each of those can be an idea to a full article. We will cover them briefly but in an exhaustive manner.

The new Angular is not just a new version of Angular. It’s a rewrite of the framework. So now we have the old Angular 1 and Angular 2 and Angular 4 and in the near future Angular 5. But the changes between Angular 2 and Angular 4 aren’t as the changes between Angular 1 and Angular 2. Angular 4 is not a rewrite. It’s a new version of Angular 2 with bug fixes and new features. Actually, in the semantic versioning approach, every six months we will get a new version of Angular. So, with all the new versions, there is a confusion with the terminology. It’s not convenient to search for learning materials in Google, questions in Stack Overflow or just talk with your partners. In order…

Top Common Mistakes of Angular Developers – Hacker Noon