Simple application of angular pipeline

What is the responsibility of the pipeline in Angular?

Conversion of the original value to the displayed value.

E.g:

Write at the front desk:

Write in the background:

 

What is displayed is:

However, if we want to display it like this, we need to use pipes.

The following is a date pipeline to achieve the above look. The date pipeline can be passed into the parameters, everyone should be able to understand.

There are many pipelines, such as number pipeline, lowercase (lowercase), uppercase (uppercase).

You can also write your own pipeline

Declare a pipeline yourself, just like the component, it must be put in the original data.

Write a multiplication pipeline  

Then call the data pipeline as above, and the call is OK.

Guess you like

Origin blog.csdn.net/weixin_44126152/article/details/105923352