Syntax
1{{ value | compact }}
Usage
- Whitespace-only strings are empty. The values
0 and false are preserved. - For objects, matching properties are removed. Nested collections are preserved.
- Serialized arrays and objects produced by another filter are recognized automatically.
Examples
Open in Playground| Data | 1{2 "items": [3 null,4 "",5 "one",6 0,7 false,8 "two"9 ]10}
|
|---|
| Template | 1{{ items | compact }}
|
|---|
| Output | 1["one",0,false,"two"]
|
|---|
Open in Playground| Data | 1{2 "values": {3 "empty": "",4 "missing": null,5 "count": 0,6 "enabled": false7 }8}
|
|---|
| Template | 1{{ values | compact }}
|
|---|
| Output | 1{"count":0,"enabled":false}
|
|---|