Angular & Signals (283 Qs)•Part 1: Architecture, Components, Directives & Lifecycle (1 - 35)
What is the difference between AngularJS and Angular?
AngularJS (version 1.x) is a JavaScript framework, whereas Angular (version 2+) is a complete rewrite of AngularJS using TypeScript, providing better performance, mobile support, modularity, and a more modern architecture.
Here are some of the major differences in tabular format:-
| AngularJS | Angular |
|---|---|
| It is based on MVC architecture | This is based on Service/Controller |
| It uses JavaScript to build the application | Uses TypeScript to build the application |
| Based on controllers concept | This is a component based UI approach |
| No support for mobile platforms | Fully supports mobile platforms |
| Difficult to build SEO friendly application | Ease to build SEO friendly applications |
Practical Code Example
typescript
// AngularJS (Legacy 1.x): Controller with $scope
// app.controller('MainCtrl', function($scope) { $scope.name = 'Legacy'; });
// Angular (2+ to 19): Standalone TypeScript Component with Class & Decorator
import { Component } from '@angular/core';
@Component({
selector: 'app-greeting',
standalone: true,
template: `<h2>Hello, {{ name }}!</h2>`
})
export class GreetingComponent {
name = 'Modern Angular';
}