I retrieve a collection of data with json data type, the json structure looks like:
These data will be displayed in data grid:
The second column displays status code, but I would like to display its description instead of code (i.e. 1:使用中、5:已關閉、9:已封存) :
How to do it?
Utilize custom pipe can solve this problem:
Step1. Create a custom pipe
Step2. Import custom pipe to your component. Here is the code snippet:
Step3. Apply pipe to your html page. Here is the code snippet: