One, use in view template
Apply Filters (filter) in an expression
The following formats are required:
{{expression | filter}} ({{expressions |}}}
For example: {{| currency}} output is $12.00
Application of filters (filter) in output results
The popular point is the filter overlay-the output of the previous filter as the input data source for the latter filter.
The following formats are required:
{{expression | filter1 | filter2 | ...}} That is, expressions (expression) are filtered using filter1 and then filtered with filter2 ...
Filter with parameters
The filter can be followed by one or more parameters to help implement the filter for special requirements and requirements.
The following formats are required:
{{expression | filter:argument1:argument2: ...}}
Example: {{1234 | number:2}} = 1,234.00
Second, using the Angluarjs built-in filter
ANGULARJS provides us with 9 built-in filters
They are currency, date, filter, JSON, LimitTo, uppercase, lowercase, number, and so on.
The specific usage is described in detail in the ANGULARJS documentation. Here are just a few common ones.
Currency Filter (currency filter)
currency– used to convert a variable into a monetary representation
For example: {{amount | currency}}
Uppercase/lowercase Filter (letter case Filter)
Such as:
{{' Lower cap string ' | uppercase}}
<input ng-model= "Userinput" > uppercased: {{userinput | uppercase}}
Date Filter (Day filter)
AngularJS Filter (Filter) usage