3
How do I catch just the id
and key
?
{
"type": "champion",
"version": "6.3.1",
"data": {
"1": {
"id": 1,
"key": "Annie",
"name": "Annie",
"title": "a Criança Sombria",
"info": {
"attack": 2,
"defense": 3,
"magic": 10,
"difficulty": 6
}
},
"2": {
"id": 2,
"key": "Olaf",
"name": "Olaf",
"title": "o Berserker",
"info": {
"attack": 9,
"defense": 5,
"magic": 3,
"difficulty": 3
}
},
"3": {
"id": 3,
"key": "Galio",
"name": "Galio",
"title": "o Sentinela da Amargura",
"info": {
"attack": 3,
"defense": 7,
"magic": 6,
"difficulty": 3
}
}
}
The array is in the variable content
, using {{content.data[1]}}
get that:
{
"id": 1,
"key": "Annie",
"name": "Annie",
"title": "a Criança Sombria",
"info": {
"attack": 2,
"defense": 3,
"magic": 10,
"difficulty": 6
}
}
But I’d like to capture only id
and key
. How can I do that?
content.data.id
?– DiegoAugusto
I tried but n worked, putting content.data[1]. id works, but no qria do 1 by 1, have to use a "for" to solve this?
– Bruno Brito
I’m putting together a solution.
– DiegoAugusto
https://jsfiddle.net/w0cL5vy9/
– Gabriel Rodrigues
@Brunobrito You will work with these values in HTML or Controller?
– DiegoAugusto
For now in HTML
– Bruno Brito