joshrathke joshrathke - 25 days ago 8
AngularJS Question

After Learning Angular 2+, How Hard is it to Learn AngularJS?

Let me start with the justification. A lot of companies that have now been using AngularJS for years are still using it, and don't have immediate plans to migrate to 4+. So there's marketability, plus the inevitable requirement of knowing both as an Angular developer.

My question is broad I know, but I am curious to hear from folks who have experience with both. Are they completely different, or will some of the knowledge transfer? For those who know both really well, what are the key differences that really stick out to you?

Answer Source

In comparison to Angular (2 and higher), AngularJS has several important limitations that affect the way applications can be built.

  • A single injector with string DI tokens and no built-in lazy loading.

  • Config/run phases and synchronous bootstrapping (the overview of configuration recipes).

  • Scope hierarchy for data binding and its consequences for application architecture - the concept of digests, performance impact, AngularJS-specific services ($timeout, $q, ...) instead of native counterparts, etc.

  • jQuery-influenced approaches for manual DOM manipulation.

  • Considerably different set and API of built-in services, directives and filters (pipes).

  • No support for nested applications (possible with a hack).

  • No view encapsulation and component styles.

  • No built-in component router.

  • No built-in translation/i18n.

  • No built-in support for workers and server side rendering.

  • No official CLI.

The development of AngularJS has been focused on providing upgrade strategies and common features since 1.5. In a lot of aspects Angular/TypeScript experience can serve as a source for best practices for modern AngularJS development.

AngularJS is generally more flexible in the ways how its injector and compiler work and allows for a plethora of neat hacks that have been rendered impractical or impossible in Angular.

There's a lot of smaller differences that AngularJS introduces which may be discarded if the goal is to intentionally limit development practices to the ones that allow to build TypeScript/ES6/ES.next AngularJS application that follows Angular guidelines and could be easily upgraded to Angular in future.

ng-metadata does its best to unify AngularJS coding practices with Angular but still requires a good understanding of the differences between two frameworks.

However, smaller differences make a big difference if a developer works on existing AngularJS project that heavily relies on them and uses legacy coding standards.