At times when we data bind, the formatting might be off. We use pipes to fix that. Pipe transforms bound properties before they're displayed to make them user friendly. Angular provides build-in pipes to format: dates, numbers, decimals, percent, currency, uppercase, etc. We use pipes to transform currency and case of the star names as examples.
- [Instructor] The state of our application…is coming along well.…But, there's a couple of things that I'd like to enhance.…I'd like to format the stars of the movie,…to be all capital.…And then also, for the cost of the tickets…to be formatted with U. S. dollars.…We do this using pipes, in Angular.…Angular provides built-in pipes to format:…dates, numbers, decimals, percents.…It also works with JSON objects.…
To get more information about pipes,…because there are quite a bit of them,…you can go to Angular's website.…And, just search pipes.…And then, you can see all the different various forms…of pipes you can use for formatting data.…For now, let's go ahead and implement some changes…in our current application.…Let's go ahead and navigate to our template.…And for the movie star name,…to transform this so that it becomes all capitals,…it's as simple as using the pipe sign.…
And then follow it, with the word uppercase.…And for changing the currency, what we'll do is,…enter in the following, followed by a pipe.…What we're doing here is,…
- Creating components
- Bootstrapping components
- Working with templates
- Using directives and interpolation
- Binding and transforming data
- Creating advanced and nested components
- Creating services
- Obtaining data with HTTP calls
- Configuring routes
Skill Level Intermediate
1. Course Overview
3. Directives, Interpolation, and Templates
5. Advanced Components
7. Obtaining Data with HTTP
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.