filmov
tv
Pipes - Angular (Tutorial #15)
Показать описание
In this video we will learn about Pipes in Angular applications
Angular JS 1.x has filters which are used for many common uses like formatting dates, string display in uppercase or lowercase etc. These filters are knows as "Pipes" in Angular
Pipes allows us to change the data before display to the user.
Normally a pipe takes the data and transforms this input to the desired output. There are two types of pipes in Angular
1) built-in pipes
2) Custom pipes
Built in pipes are already created in angular ,we just need to call that if we want to use it. If Built-in pipes are not sufficient for project needs we are free to create custom pipes
There are 10 built in pipes in angular
1) Uppercase
2)Lowercase
3)Titlecase
4)date
5)Currency
6)Number
7)date
8)slice
9)json
10)async
Syntax :
{{ expression | pipename:arguments }}
Whenever you want to use pipe just use pipe name followed by pipe(|) character. Pipes are methods behind the scene , so methods can take arguments in same manner pipe can also take argument which you will pass after colonn(:)
Chaining of Pipe: Sometime we want to use more than one pipe on same expression so this is called chaining of pipe. So here suppose we want to apply date and uppercase together on dob express
{{dob | date | uppercase}}
In this case output of date pipe will act like a input for uppercase pipe
If you liked my channel , subscribe to it and like my videos. For any queries ask you question in comment section
you can also connect with me @
Angular JS 1.x has filters which are used for many common uses like formatting dates, string display in uppercase or lowercase etc. These filters are knows as "Pipes" in Angular
Pipes allows us to change the data before display to the user.
Normally a pipe takes the data and transforms this input to the desired output. There are two types of pipes in Angular
1) built-in pipes
2) Custom pipes
Built in pipes are already created in angular ,we just need to call that if we want to use it. If Built-in pipes are not sufficient for project needs we are free to create custom pipes
There are 10 built in pipes in angular
1) Uppercase
2)Lowercase
3)Titlecase
4)date
5)Currency
6)Number
7)date
8)slice
9)json
10)async
Syntax :
{{ expression | pipename:arguments }}
Whenever you want to use pipe just use pipe name followed by pipe(|) character. Pipes are methods behind the scene , so methods can take arguments in same manner pipe can also take argument which you will pass after colonn(:)
Chaining of Pipe: Sometime we want to use more than one pipe on same expression so this is called chaining of pipe. So here suppose we want to apply date and uppercase together on dob express
{{dob | date | uppercase}}
In this case output of date pipe will act like a input for uppercase pipe
If you liked my channel , subscribe to it and like my videos. For any queries ask you question in comment section
you can also connect with me @
Комментарии