Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Angular for .NET Developers

You're reading from   Learning Angular for .NET Developers Develop dynamic .NET web applications powered by Angular 4

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781785884283
Length 248 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rajesh Gunasundaram Rajesh Gunasundaram
Author Profile Icon Rajesh Gunasundaram
Rajesh Gunasundaram
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started with Angular FREE CHAPTER 2. Angular Building Blocks - Part 1 3. Angular Building Blocks - Part 2 4. Using TypeScript with Angular 5. Creating an Angular Single-Page Application in Visual Studio 6. Creating ASP.NET Core Web API Services for Angular 7. Creating an Application Using Angular, ASP.NET MVC, and Web API in Visual Studio 8. Testing Angular Applications 9. What s New in Angular and ASP.NET Core

Pipes


Pipes in Angular are a replacement of filters in AngularJS 1.x. Pipes are an improved version of filters that transform common data. Most of the applications fetch data from a server and transform it before displaying the data on the frontend. In such cases, pipes are very useful in transforming the data on rendering the template. Angular provides these cool API pipes for this purpose. Pipes take data as input and output transformed data as needed.

Common pipes

The following are the built-in pipes available in @angular/core, and we will see a few pipes with examples:

  • AsyncPipe
  • CurrencyPipe
  • DatePipe
  • DecimalPipe
  • I18nPluralPipe
  • I18nSelectPipe
  • JsonPipe
  • LowerCasePipe
  • PercentPipe
  • SlicePipe
  • TitleCasePipe
  • UpperCasePipe

Pipe with parameters

We can pass parameters to a pipe followed by a colon (:) symbol, as follows:

<p>Price of the book is {{ price | currency:'USD' }} </p>

Multiple inputs to a pipe can be added by separating the values by (:), as shown:

<li *ngFor="let book of books | slice:1:3...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image