作者:小心大巧 | 来源:互联网 | 2023-01-31 06:38
Iwouldliketobeabletogetandlistthekeys(notvalues)fromtheparamsarrayinthisJSONObj
I would like to be able to get and list the keys (not values) from the params array in this JSON Object, using the *ngfor directive in an ionic2 page.
我希望能够使用ionic2页面中的* ngfor指令从此JSON对象中的params数组中获取并列出键(而不是值)。
{
"id":"x",
"name":"xxx",
"code":"xxx",
"description":"xxx",
"params":
[
{"param1": "params1"},
{"param2": "params2"},
{"param3": "params3"}
]
}
I have searched around this forum and found an implementation using pipes; but I have been unsuccessful so far. The most I've been able to obtain using the pipes are the array indexes, but not the keys.
我搜索了这个论坛,发现了一个使用管道的实现;但到目前为止我还没有成功。我使用管道获得的最多是数组索引,但不是密钥。
1 个解决方案