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'}});
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Dipak Kumar Singh
Dipak is a skilled HTML Developer, expertise in UI Development. Dipak likes watching movies and playing computer games.