Difference between Angular 4 and Angular 5


Don’t get panic, There is no major difference or upgrades. They have made some upgrades internally in order to improve the performance. Here is the few new features of Angular 5.

1. Build Optimizer.

Compared to Angular 4, this features is used to remove unnecessary code from the application.

2. Angular Universal State Transfer API and DOM Support

By using Angular Universal State transfer API, we can easily share the application states between server side and client side.

3. Improvement in Compiler

In Angular 5, they increased compilation of the application when compared with Angular 4. You don’t need to write any additional code to get this feature. By default, Angular 5 comes with an improvement in Compiler.

4. Option to protect new lines and empty spaces.

In Angular 4 and earlier versions, unwanted lines, tabs and empty spaces were created during the application compilation time. Also you can’t prevent it. Now in Angular 5, you have option to prevent it. You can restrict them in terms of Application level, module level and component level.
For ex.,

@Component({
templateUrl: ‘test.component.html’,
preserveWhitespaces: false
}
export class TestComponent {}

5. Defined and Increased standardization across all browser

In earlier versions, if your application wants to do internationalization for you application, you should depend on i18n. Now in Angular 5, you don’t need to depend on i18n, by default it provides new date, currency, number and pipes which increases the internationalization across all browser and no need to depend on i18n.

6. Introduced exportAs

In Angular 5, you can use multiple names for export directives and components.

7. New HttpClient Module

In Angular 4, we have @angular/HTTP to handle all kinds of http requests. In Angular 5 @angular/HTTP is deprecated and Introduced HttpClientModule. You can access the package under @angular/common/http

8. Angular 5 supports TypeScript version 2.3

Get First Session Free

Book your FREE First Session for the Best Angular 5 Training.