Stable Release in branch 4.0
4.4.7
Released 16 Apr 2018
(8 years ago)
SoftwareAngular
Version4.0
Initial release4.0.0
23 Mar 2017
(9 years ago)
Latest release4.4.7
16 Apr 2018
(8 years ago)
Active support end23 Sep 2017
(Ended 8 years ago)
Security support end23 Sep 2018
(Ended 7 years ago)
Commercial support
(HeroDevs-NES)
Yes
Release noteshttps://github.com/angular/angular/blob/main/CHANGELOG_ARCHIVE.md#400-invisible-makeover-2017-03-23
Source codehttps://github.com/angular/angular/tree/4.4.7
Documentationhttps://angular.io/docs
Angular 4.0 ReleasesView full list

What Is New in Angular 4.0

Category Key Changes
New Features ngIf with else, as keyword for ngIf, Angular Universal merges, TypeScript 2.1/2.2 compatibility
Performance Reduced bundle size, Generated code improvements, View Engine optimizations
Breaking Changes Strict null checking, Template tag changes, NgFor change
Deprecations OpaqueToken, ngFor with comma-separated expression

What are the major performance improvements in Angular 4.0?

The bundle size reduction is the headline performance win. The framework core is now significantly smaller, which directly improves application load times. This was achieved through extensive code refactoring and tree-shaking enhancements.

The new View Engine, dubbed "Generated code for AOT compilers," produces less code for generated components. In practice, this means your production bundles are more compact and efficient, leading to faster applications.

What new template syntax features were introduced?

Angular 4.0 enhances ngIf with an else clause, making conditional templates much cleaner. You can now define a template block to show when the condition is false.

<div *ngIf="user; else loggedOut">
  Welcome, {{user.name}}.
</div>
<ng-template #loggedOut>
  Please log in.
</ng-template>

The as keyword is another addition, allowing you to store a conditional result as a local variable. This is great for avoiding redundant async pipe subscriptions like *ngIf="userObservable | async as user".

What breaking changes should developers watch for?

Angular now enforces stricter null checks. The Renderer class has been removed in favor of the more specific Renderer2, which is a breaking change for any code directly depending on the old renderer.

The template <template> tag is now deprecated. You should use <ng-template> instead. Similarly, the comma-separated expression in ngFor is deprecated; use the let syntax instead.

Before (Deprecated)

<div *ngFor="#item of items; #i = index"></div>

After

<div *ngFor="let item of items; let i = index"></div>

How has dependency injection evolved?

OpaqueToken is now deprecated. The modern replacement is InjectionToken, which supports generic types for better type safety across your application.

Before (Deprecated)

import { OpaqueToken } from '@angular/core';
export const MY_SERVICE = new OpaqueToken('my.service');

After

import { InjectionToken } from '@angular/core';
export const MY_SERVICE = new InjectionToken<MyServiceType>('my.service');

What about TypeScript and server-side rendering?

This release officially supports TypeScript 2.1 and 2.2. This matters because it unlocks newer TypeScript language features for your development, improving the overall coding experience.

Angular Universal, the project for server-side rendering, was merged into the main Angular repository. This signals a stronger commitment to Universal and makes it easier to keep it in sync with core framework changes.

FAQ

Is the switch from OpaqueToken to InjectionToken urgent?
It's a deprecation, not an immediate removal. You should plan to migrate for future-proofing and better type safety, but your existing code won't break in 4.0.

Why did my bundle size get smaller?
The Angular core team refactored the codebase to be more tree-shakable. The new View Engine also generates more efficient code during AOT compilation, stripping out unused parts more effectively.

What's the real benefit of the *ngIf else syntax?
It eliminates the need for dual *ngIf statements to show an alternative view. This makes your templates more declarative, readable, and easier to maintain.

I use the Renderer class--what should I do?
You need to migrate to Renderer2. It's the new API for DOM manipulation and is designed to be more future-proof. The change is required for upgrading.

Does this release improve change detection?
While not a headline feature, the underlying generated code from the View Engine is more optimized, which can contribute to marginally faster change detection cycles in your application.

Releases In Branch 4.0

VersionRelease date
4.4.716 Apr 2018
(8 years ago)
4.4.619 Oct 2017
(8 years ago)
4.4.512 Oct 2017
(8 years ago)
4.4.428 Sep 2017
(8 years ago)
4.4.319 Sep 2017
(8 years ago)
4.4.218 Sep 2017
(8 years ago)
4.4.015 Sep 2017
(8 years ago)
4.4.115 Sep 2017
(8 years ago)
4.4.0-RC.002 Sep 2017
(8 years ago)
4.3.623 Aug 2017
(8 years ago)
4.3.516 Aug 2017
(8 years ago)
4.3.410 Aug 2017
(8 years ago)
4.3.302 Aug 2017
(9 years ago)
4.3.227 Jul 2017
(9 years ago)
4.3.119 Jul 2017
(9 years ago)
4.3.014 Jul 2017
(9 years ago)
4.2.608 Jul 2017
(9 years ago)
4.3.0-rc.008 Jul 2017
(9 years ago)
4.2.530 Jun 2017
(9 years ago)
4.3.0-beta.129 Jun 2017
(9 years ago)
4.2.422 Jun 2017
(9 years ago)
4.3.0-beta.022 Jun 2017
(9 years ago)
4.2.316 Jun 2017
(9 years ago)
4.2.212 Jun 2017
(9 years ago)
4.2.109 Jun 2017
(9 years ago)
4.2.008 Jun 2017
(9 years ago)
4.2.0-rc.201 Jun 2017
(9 years ago)
4.2.0-rc.126 May 2017
(9 years ago)
4.2.0-rc.019 May 2017
(9 years ago)
4.1.317 May 2017
(9 years ago)
4.1.210 May 2017
(9 years ago)
4.2.0-beta.110 May 2017
(9 years ago)
4.1.104 May 2017
(9 years ago)
4.2.0-beta.004 May 2017
(9 years ago)
4.1.026 Apr 2017
(9 years ago)
4.0.321 Apr 2017
(9 years ago)
4.1.0-rc.021 Apr 2017
(9 years ago)
4.1.0-beta.112 Apr 2017
(9 years ago)
4.0.211 Apr 2017
(9 years ago)
4.1.0-beta.030 Mar 2017
(9 years ago)
4.0.129 Mar 2017
(9 years ago)
4.0.0-rc.623 Mar 2017
(9 years ago)
4.0.023 Mar 2017
(9 years ago)
4.0.0-rc.417 Mar 2017
(9 years ago)
4.0.0-rc.517 Mar 2017
(9 years ago)
4.0.0-rc.310 Mar 2017
(9 years ago)
4.0.0-rc.202 Mar 2017
(9 years ago)
4.0.0-rc.025 Feb 2017
(9 years ago)
4.0.0-rc.125 Feb 2017
(9 years ago)
4.0.0-beta.818 Feb 2017
(9 years ago)
4.0.0-beta.709 Feb 2017
(9 years ago)
4.0.0-beta.603 Feb 2017
(9 years ago)
4.0.0-beta.525 Jan 2017
(9 years ago)
4.0.0-beta.419 Jan 2017
(9 years ago)
4.0.0-beta.311 Jan 2017
(9 years ago)
4.0.0-beta.206 Jan 2017
(9 years ago)
4.0.0-beta.122 Dec 2016
(9 years ago)
4.0.0-beta.015 Dec 2016
(9 years ago)