How to access the contents of this subArray?

Asked

Viewed 42 times

0

I can access the contents of an Array like this:

{{teste02[0]}}

And I get as return the following:

{"assigned_date":"1969-12-31 21:00:00.000","user_id":"101","role_id":"101","group_id":
{"path":"/administrador","displayName":"Administrador","icon":"",
"name":"administrador","description":"","parent_path":"",
"creation_date":"2017-08-18 11:04:28.846","id":"302",
"created_by_user_id":"-1","last_update_date":"2017-08-18 11:04:28.846"},"assigned_by_user_id":"-1"}

But what I really need is to access subArray content name. I’ve tried to {{teste02[0][0].name}} but nothing is returned to me, how could I access this?

  • I found out, actually, the way I should have put it was like this: {{teste02[0].group_id.name}}, I don’t know if in that case I’ll close the question or just answer it with this, if you can tell me the right thing to do thank you

  • You can answer what you did to resolve and if you have references on the subject post in your reply.!

1 answer

0


The problem was the way I tried to access subArray’s content, I had missed the full path I needed to make available to access its content.

Initially I had put so: {{teste02[0].name}} But before I could access this content there was the subArray group_id. In the end it was right to put it like this : {{teste02[0].group_id.name}}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.