1
I’m getting a JSON array in the back end this way :
{
"idDistrito": "23",
"nome": "rere",
"codigoDne": "154545",
"cns": "565665",
"entidade": {
"idEntidade": "1",
"nome": "Entidade 01"
},
"emissaoProfissional": "07/11/2017"
}
I would like to know how to separate attributes from variables to assemble a table where attributes would be column and variables would be rows.
If I understand correctly you want to mount a table through the result of a
Json
?– Marconi
@Marconi yes that’s the idea.
– Eduardo Krakhecke
You can post your Json (or at least part of it) in the code instead of the image?
– Marconi
yes, I’ll edit the question.
– Eduardo Krakhecke
@Marconi edited the question and included the code
json
– Eduardo Krakhecke
I think he meant the code that generates Json
– Victor
The question is: structure of all objects within the array will be the same or can differentiate? I mean, if there is an object that can come with
nome
and others not...– BrTkCa
@Lucascosta in the case of this page some items are not mandatory, for example the
codigoDne
may come empty. but the attribute will come.– Eduardo Krakhecke
@Eduardokrakhecke You are using Angularjs?
– Carlos Scherer
I use Angularjs yes.. But some functions prefer Javascript
– Eduardo Krakhecke
@Eduardokrakhecke I think what you need is in the answer below!
– Marconi