Hello again, everyone.
So in this lesson, we're going to talk about pipes and angular.
All right.
So we can define an angular pipe feature briefly and well, I'd say simply as filtering or conversion.
So the bike process can be defined as sending a value or data.
Into pipes, processing these values and generating a new value according to the transformations in
itself.
So the data we receive may not always be in the form that we want to use.
So in cases like that, we'll need to take action on that incoming data.
Also, apart from pipes and angular, it can be written in private pipes.
For example, we may want all the letters of a word to be upper or lower case, well, in cases like
that, we can get help from pipes.
Now, to see the pipes defined and angular itself, I'll just open up the angular homepage.
I'll open up an API list from here and write a pipe into the search bar.
So, look, there are already existing pipes that we can use, for example, there's a tidal pipe for
capitalization or decimal pipe for numeric data.
So now let's examine the use of a few of these pipes are.
So we'll define some variables in our test file.
Now, another type is string and No.
So I have defined our variables.
Now let's have a look at the use of pipes and templates.
So first of all, I want to use our strong variable.
So I'll get the variable with the string interpolation.
Now let's see the first writing, so I'm copying this and the initial values all lowercase.
So I'm going to do a pipe sign for this and then I'll write lowercase.
Then I want the initials to be capitalized.
I'll write this sign again for this and this time I am typing title case.
So now when we look at the changes, as you can see, there are the different formats.
So, yeah, it really is that easy to use existing pipes.
So let's say that we want to do some number format's.
So we'll print this number and do it in a number format.
We see that the number is written.
And, well, certainly an easier way to read.
So now I want to format a number with a decimal, so I print this number in a number format of prints
like this.
But I want to print it in a different format.
So I will write the format that I want to print in single quotes, so let's say that I want this number
to have three digits after the comma.
So for this.
All right, one dot three, dash three.
And actually, here is the part that displays the minimum number of digits and the maximum number of
digits after the comma.
And as you can see, there are three digits after the comma.
And if we change this to.
It rounds the numbers and writes two digits.
All right, so you may be thinking, but it doesn't matter because I want to show it to you anyway,
let's say that I want to write a date format.
So I'm writing, you know what, no, let's assign today's date to a variable.
That's a number, so I'll print it normally.
So I'll also print it in date format.
Now, look, the first value is a little meaningless to us, right, wrote milliseconds.
Well, here it wrote in this format, so, yeah, let's examine this pipe here.
So to do this, let's review the angular homepage.
So start examining pipes from here, and I'm looking for date format's.
So now when we use a short date, the result will be written in this format.
Or when we write medium, it will be written in this format.
And this is how you can actually write it in a longer format.
So instead of writing medium, we can define it to be long like this.
And the result will be the same again.
Now, it's already defined this way and angular.
We can always use a shortcut.
So looking at this from here, these letters indicate the month, year to date or time.
For example, we'll use the short date format.
And we'll write it briefly.
And will write the long use like here.
And as you can see, they both give us the same result, right?
And we could always write something different if we want to hear, for example, let's only add the
month and day information, or we can always had the time information here.
All right, so you can play around with that yourselves, so that's how you use pipes.
I want to see in the next lesson.