
- Angular Tutorial
- Angular - Home
- Angular - Overview
- Angular - Features
- Angular - Advantages & Disadvantages
- Angular Basics
- Angular - Environment setup
- Angular - First Application
- Angular - MVC Architecture
- Angular Components
- Angular - Components
- Angular - Component Lifecycle
- Angular - View Encapsulation
- Angular - Component Interaction
- Angular - Component Styles
- Angular - Nested Components
- Angular - Content projection
- Angular - Dynamic components
- Angular - Elements
- Angular Templates
- Angular - Templates
- Angular - Template statements
- Angular - Template Variables
- Angular - SVG as Templates
- Angular Binding
- Angular - Data Binding
- Angular - Interpolation
- Angular - Event Binding
- Angular - Property Binding
- Angular - Attribute Binding
- Angular - Class Binding
- Angular - Style Binding
- Angular - Two-way Binding
- Angular Directives
- Angular - Directives
- Angular - Attribute Directives
- Angular - Structural Directives
- Angular - Custom Directives
- Angular Pipes
- Angular - Pipes
- Angular - Built-in Pipes
- Angular - Custom Pipes
- Angular Forms
- Angular - Forms
- Angular - Template Driven Forms
- Angular - Reactive Forms
- Angular - Form Validation
- Angular - Dynamic Forms
- Angular Dependency Injection
- Angular - Dependency Injection
- Angular - Injectable Service
- Angular Routing
- Angular - Routing
- Angular - Dynamic Routes
- Angular - Wildcard Routes
- Angular - Nested Routes
- Angular - Navigation
- Angular - Routing in SPA
- Angular - Custom Route Matches
- Angular - Router Reference
- Angular HTTP Client programming
- Angular - Services
- Angular - HTTP Client
- Angular - Request
- Angular - Response
- Angular - GET
- Angular - POST
- Angular - PUT
- Angular - DELETE
- Angular - JSONP
- Angular - CRUD Operations Using HTTP
- Angular Modules
- Angular - Introduction to Modules
- Angular - Root Module
- Angular - Feature Module
- Angular - Sharing Module
- Angular - Routing Module
- Angular - NgModules
- Angular Animation
- Angular - Animations
- Angular Service Workers & PWA
- Angular - Service Workers & PWA
- Angular Testing
- Angular - Testing Overview
- Angular Design Patterns
- Angular - Design Patterns
- Angular - Lazy Loading
- Angular - Singleton Pattern
- Angular - Observer Pattern
- Angular Libraries
- Angular - Libraries
- Angular - Angular Material
- Angular - PrimeNG
- Angular - RxJS
- Angular Advanced
- Angular - Signals
- Angular - Authentication & Authorization
- Angular - Internationalization
- Angular - Standalone Component
- Angular - Accessibility
- Angular - Web Workers
- Angular - Server Side Rendering
- Angular - Ivy Compiler
- Angular - Building with Bazel
- Angular - Backward Compatibility
- Angular - Reactive Programming
- Angular Tools
- Angular - CLI
- Angular Material UI Elements
- Angular - Paginator
- Angular - Datepicker
- Angular - Select Drop-down
- Angular Miscellaneous
- Angular - Third Party Controls
- Angular - Configuration
- Angular - Displaying Data
- Angular - Decorators & Metadata
- Angular - Basic Example
- Angular - Error Handling
- Angular - Testing & Building a Project
- Angular - Lifecycle Hooks
- Angular - User Input
- Angular - What's New?
- Angular Useful Resources
- Angular - Quick Guide
- Angular - Useful Resources
- Angular - Discussion
Angular - Transforming Data Using Pipes
Angular has a lot of filters and pipes that can be used to transform data.
lowercase
This is used to convert the input to all lowercase.
Syntax
Propertyvalue | lowercase
Parameters
None
Result
The property value will be converted to lowercase.
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { TutorialName: string = 'Angular JS2'; appList: string[] = ["Binding", "Display", "Services"]; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The name of this Tutorial is {{TutorialName}}<br> The first Topic is {{appList[0] | lowercase}}<br> The second Topic is {{appList[1] | lowercase}}<br> The third Topic is {{appList[2]| lowercase}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

uppercase
This is used to convert the input to all uppercase.
Syntax
Propertyvalue | uppercase
Parameters
None.
Result
The property value will be converted to uppercase.
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { TutorialName: string = 'Angular JS2'; appList: string[] = ["Binding", "Display", "Services"]; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The name of this Tutorial is {{TutorialName}}<br> The first Topic is {{appList[0] | uppercase }}<br> The second Topic is {{appList[1] | uppercase }}<br> The third Topic is {{appList[2]| uppercase }}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

slice
This is used to slice a piece of data from the input string.
Syntax
Propertyvalue | slice:start:end
Parameters
start − This is the starting position from where the slice should start.
end − This is the starting position from where the slice should end.
Result
The property value will be sliced based on the start and end positions.
Example
First ensure the following code is present in the app.component.ts file
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { TutorialName: string = 'Angular JS2'; appList: string[] = ["Binding", "Display", "Services"]; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The name of this Tutorial is {{TutorialName}}<br> The first Topic is {{appList[0] | slice:1:2}}<br> The second Topic is {{appList[1] | slice:1:3}}<br> The third Topic is {{appList[2]| slice:2:3}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

date
This is used to convert the input string to date format.
Syntax
Propertyvalue | date:dateformat
Parameters
dateformat − This is the date format the input string should be converted to.
Result
The property value will be converted to date format.
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { newdate = new Date(2016, 3, 15); }
Next, ensure the following code is present in the app/app.component.html file.
<div> The date of this Tutorial is {{newdate | date:"MM/dd/yy"}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

currency
This is used to convert the input string to currency format.
Syntax
Propertyvalue | currency
Parameters
None.
Result
The property value will be converted to currency format.
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { newValue: number = 123; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The currency of this Tutorial is {{newValue | currency}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

percentage
This is used to convert the input string to percentage format.
Syntax
Propertyvalue | percent
Parameters
None
Result
The property value will be converted to percentage format.
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { newValue: number = 30; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The percentage is {{newValue | percent}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.

There is another variation of the percent pipe as follows.
Syntax
Propertyvalue | percent: {minIntegerDigits}.{minFractionDigits}{maxFractionDigits}
Parameters
minIntegerDigits − This is the minimum number of Integer digits.
minFractionDigits − This is the minimum number of fraction digits.
maxFractionDigits − This is the maximum number of fraction digits.
Result
The property value will be converted to percentage format
Example
First ensure the following code is present in the app.component.ts file.
import { Component } from '@angular/core'; @Component ({ selector: 'my-app', templateUrl: 'app/app.component.html' }) export class AppComponent { newValue: number = 0.3; }
Next, ensure the following code is present in the app/app.component.html file.
<div> The percentage is {{newValue | percent:'2.2-5'}}<br> </div>
Output
Once you save all the code changes and refresh the browser, you will get the following output.
