dimanche 2 septembre 2018

Fetch data from a nested array

I would like to know if there is a way to get the length from a nested array.

My data is a JSON file like this:

{
  "data" :[
         "item1" :'',
         "item2" :[
           {
            "id" :1,
            "text":'text'
            }, 
            {
             "id" :2,
             "text" : 'text 
           } 
            ]
}

I'm using angular 6 and ngx-restangular. Is possible to get the item 2 length?




Aucun commentaire:

Enregistrer un commentaire