Understanding Async Pipe in Angular 4
Posted By : Satwinder Singh | 17-May-2018
What are Pipes?
Piper is a feature built in Angular 2 which basically allows us to transform output in our template. This is the main purpose of the pipe that it transforms the output. There are pipes for different types of output and also for synchronous and asynchronous data. Let’s take a simple example of a username property which we are outputting somewhere using string interpolation like this - <p>{{ username }}</p> and we want the output should be all uppercase but only when you output it. So, we don’t want to change the property itself in uppercase but we want to change the way it is displayed when we render it to the screen. For this, we can use a pipe namely the uppercase pipe like this-
<p>{{ username | uppercase }}</p> which is actually a built-in pipe. So, by using this pipe we will see the username all displayed uppercase on the screen because this is what it does i.e. it transforms the value.
Using the “ async ”
There is another built-in pipe in Angular 2 which does something different from all other pipes i.e. it
Now, if we try to output the
<h2> App Status : {{
<h2> App Status : {{
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
Satwinder Singh
Satwinder had been working as a free-lancer for past 1-year and recently joined Oodles Technologies as a UI-Developer. His skills are : Jquery , Html , Css , Bootstrap and Javascript.