What is the difference between AngularJS and Angular?
Answer
AngularJS (Angular 1.x) was the original framework released in 2010. Angular (2+) is a complete rewrite released in 2016. They are fundamentally different frameworks sharing only a name. Key differences: Language: AngularJS used JavaScript; Angular uses TypeScript (with JavaScript support). Architecture: AngularJS used MVC (Model-View-Controller) pattern with scopes and controllers; Angular uses component-based architecture — everything is a component. Data binding: AngularJS used two-way data binding everywhere (dirty checking with $scope — performance issues at scale); Angular uses one-way data flow by default with optional two-way binding ([(ngModel)]), and change detection is much more efficient. Dependency injection: AngularJS had a string-based DI system (fragile, especially with minification); Angular has a hierarchical DI system based on TypeScript type annotations. Performance: AngularJS used digest cycles for change detection (slow for large apps); Angular uses zones and smarter change detection (OnPush strategy available). Mobile support: AngularJS was not designed for mobile; Angular has NativeScript and Ionic support. CLI: AngularJS had no official CLI; Angular has the powerful Angular CLI. Modularity: AngularJS had limited module system; Angular has NgModules (and now standalone components). AngularJS reached end-of-life in December 2021.