Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction to Angular  ›  Lesson

Angular and Its History

Angular and History 12 minAngular is Google's TypeScript framework for building web apps from components, and it is a complete rewrite of the older AngularJS rather than a new version of it.

Angular and Its History

You search for an Angular answer and find two tutorials that look nothing alike. One is full of $scope and ng-controller; the other uses classes, decorators and signal(). Both say "Angular". Knowing the history lets you tell in five seconds which one is useful to you.

The rule

AngularJS is the old framework; Angular is its rewrite, not its upgrade.

AngularJS appeared in 2010 at Google. It was plain JavaScript, and it made HTML "smarter" with attributes like ng-model and ng-repeat. It became hugely popular, but large apps grew slow and hard to organise.

So the team started over. Angular (released in 2016 as "Angular 2") was written in TypeScript and built around components: small classes that each own a piece of the page. The name dropped the "JS" to mark the break. The two cannot be mixed in one file, and moving an app from one to the other means rewriting it. AngularJS reached the end of official support at the end of 2021.

Since then Angular ships a new major version about every six months, and recent versions changed how everyday code looks:

  • Standalone components replaced the need for NgModule wrappers.
  • Signals give a simple, fine-grained way to hold changing values.
  • Built-in control flow (@if, @for, @switch) replaced the older *ngIf and *ngFor style for new code.

Here is the component this course keeps building, Greenhouse, an app that tracks house plants and when to water them:

import { Component, signal } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `<h1>{{ title() }}</h1>`,
})
export class App {
  title = signal('Greenhouse');
}

The shortcut

Scan the code for one fingerprint. $scope, ng- attributes, or angular.module(...) mean AngularJS. @Component, TypeScript classes, signal() or @if mean modern Angular. Within modern Angular, standalone components and @if blocks mark current style, while NgModule and *ngIf mark older (still working) style.

Dating a code sampleStep 1 of 4
  1. Look for $scope or ng-controller

    Found $scope.plants = []? That is AngularJS. Put the tutorial aside.

The common trap is treating "Angular 1" and "Angular 17" as neighbours on one line. They are different frameworks that share a name and a company.

Drills

Answer fast — trust the rule.

quick drill

A code sample uses $scope.plants. Which framework is it written for?

quick drill

How did Angular (version 2) relate to AngularJS?

quick drill

Roughly how often does Angular release a new major version?

quick drill

Which of these marks the most current style of Angular template?

Remember

  • AngularJS (2010, JavaScript) and Angular (2016 on, TypeScript, components) are different frameworks.
  • Shortcut: $scope or ng- means AngularJS; @Component and signal() mean Angular.
  • Trap: older Angular samples (NgModule, *ngIf) still work but are no longer how new code is written.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhich Angular is this?

A colleague finds a tutorial that uses ng-controller and $scope, and another that uses @Component and signal(). Explain which one describes the Angular you should learn today and how you can tell the two apart.