转载:https://www.cnblogs.com/zhangshuda/p/7640082.html
1、大写
{{'abcde' | uppercase}}
2、小写
{{'ABC' | lowercase}}
3、货币格式
{{12345 | currency}}
{{ 250 | currency:"RMB ¥ " }}
4、向指令添加过滤器
按照country排序
{{ x.name + ', ' + x.country }}
5、过滤输入
Document
-
{{ (x.name | uppercase) + ', ' + x.country }}
Document
{{'abc' | reverse}}
8、查找
{{ [{"age": 20,"id": 10,"name": "iphone"},
{"age": 12,"id": 11,"name": "sunm xing"},
{"age": 44,"id": 12,"name": "test abc"}
] | filter:{'name':'iphone'} }}
{{"1234567890" | limitTo :6}} // 从前面开始截取6位
{{"1234567890" | limitTo:-4}} // 从后面开始截取4位
// 根id降序排
{{ [
{"age": 20,"id": 10,"name": "iphone"},
{"age": 12,"id": 11,"name": "sunm xing"},
{"age": 44,"id": 12,"name": "test abc"}
] | orderBy:'id':true }}
{{
[{"age": 20,"id": 10,"name": "iphone"},
{"age": 12,"id": 11,"name": "sunm xing"},
{"age": 44,"id": 12,"name": "test abc"}
] | orderBy:'id' }}
Document
newString: {{"jj" | myfilter:1:2:3:5}}
Document
{{aa}}
{{"1234567890" | limitTo :6}} // 从前面开始截取6位
{{"1234567890" | limitTo:-4}} // 从后面开始截取4位