A Description of what is new In Angular 4

Posted By : Dipak Kumar Singh | 26-Jun-2017

What is new in Angular 4?

In this blog, I will explain what the new changes in Angular 4 are. AngularJS is one of the most poupular JavaScript frameworks to create Web apps. It is maintained by Google. 

Let's see what are the new changes made in Angular 4.0. 

ngIf(template)

In Angular 2.0, if we wanted to use ngIf with multiple conditions or specifically with else, we write, as shown below.

<div *ngIf="data.length = 0; else empty">

<h1>Hello AngularJS</h1>

</div>

<ng-template #empty><h1>Hello<h1></ng-template>

 

as(template)

Another addition to template syntax is the as Keyword, to simplify the let syntax.It allows to store a result in variable of the template,to use it in the element.

example:

<div *ng-For ="let data of collection | slice:0:4 as totalcollection; count as i">

{{i++}}/{{totalcollection}}:{{data.user}}

</div>

 

Titlecase(pipes)

It is type of pipes.It change the frist letter of word into uppercase.

<h1>{{"hello angular"}}<h1>

<!--

display 'Hello Angular'

-->

Http(Pipes)

 

In Angular 4 we Adding search parameters to an HTTP request has been simplified.
Like below example

http.get('${baseUrl}/api/user',{params:{sort:'descending'}});

 

About Author

Author Image
Dipak Kumar Singh

Dipak is a skilled HTML Developer, expertise in UI Development. Dipak likes watching movies and playing computer games.

Request for Proposal

Name is required

Comment is required

Sending message..