WEB DEVELOPER SITE
PYTHONJAVA
 

Angular 4 Introduction


It is JavaScript-based open-source front-end web application framework mainly maintained by Google .


First version of Angular 1 it is called AngularJS. Angular 2 was many changes after AngularJS. Angular 4 is almost the same as Angular 2.

Angular 4 started in March 2017 released to be a noteworthy achievement and is the most recent discharge from the Angular group after Angular2. Let us now look the new features and the changes made in Angular 4.

Angular 4 but Not Angular 3

The Angular group confronted some forming issues inside with their modules and because of the contention they needed to proceed onward and discharge the following variant of Angular – the Angular4. Let us now look the new features change Angular 4 −
ngIf
Angular 2 only support if condition.But Angular 4 supports the if else condition.look at how it works using the ng-template.
Condition is valid.
Condition is invalid.

as keyword in for loop

as keyword you can store the value as listed below-
 	<div *ngFor="let i of days | slice:0:5 as total">
   Days: {{i}} Total: {{total.length}}
 	</div>



The variable total stores the output of the slice using the as keyword.

Animation Package

animation package in Angular 4 is supported and imported from @angular/animations where as Angular 2 was @angular/core.

Template

Angular 4 utilizes <ng-template> as the tag rather than <template>; the last was utilized in Angular2. The reason Angular 4 changed <template> to <ng-template> is a result of the name conflict of the <template> tag with the html <template> standard tag. It will censure totally proceeding. This is one of the major changes in Angular 4.

TypeScript 2.2

Angular 4 is updated to a recent version of TypeScript, which is 2.2. This helps improve the speed and gives better type checking in the project.

Http Search Parameters

Angular 4 change for Search parameters to the http get api is simplified.