Angular pipes provide us an important feature of formatting / transforming data to a
desired way in the view.
For example date formatting is one common requirement which we need in all applications. Angular provide different Date Pipes like shortDate, longDate, fullTime etc which come in handy to display different formats of dates in the UI.
For example date formatting is one common requirement which we need in all applications. Angular provide different Date Pipes like shortDate, longDate, fullTime etc which come in handy to display different formats of dates in the UI.
Another common formatting requirement is the currency formatting, Angular provides a CurrencyPipe for currency formatting. The CurrencyPipe transforms a number to a currency string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations. The CurrencyPipe also takes additional parameters to further format the currency codes to display, number of digits to display etc
Apart from DatePipe and CurrencyPipe, there are many other types of built-in pipes available in Angular, as follows.
Upper/Lower/Title case pipes
Json Pipe
Slice Pipe
Async Pipe
Decimal Pipe
Percent Pipe etc.
No comments:
Post a Comment