Angular 4 is a JavaScript framework developed by Google for building single-page applications (SPAs) that are dynamic, responsive, and scalable. It's an upgrade to Angular 2, introducing several enhancements while maintaining a core philosophy of component-based architecture.
The development of Angular started with AngularJS, which was released in 2010. Angular 4, announced in December 2016 and released in March 2017, is a major update following Angular 2, which itself was a complete rewrite from AngularJS. Angular 4 aimed at:
Angular 4 focused on reducing the bundle size, which was achieved by:
Angular 4 was released with compatibility for TypeScript 2.1 through 2.4, which brought in features like:
Animations were moved out of the core framework into a separate package, allowing developers to opt-in if needed, thus reducing the bundle size for those who don't require animations.
Angular 4 introduced:
ng-template
syntax for embedding views.*ngIf
.titlecase
pipe.Form validation was improved, with:
min
, max
, and pattern
for reactive forms.Angular 4 introduced a new HTTP client module which provides better typing and response handling. This module was later moved to a separate package in Angular 5.
Angular 4 has a robust ecosystem with:
Upgrading from Angular 2 to Angular 4 was relatively straightforward due to: