title: How to get data from nested JSON in TypeScript?
body: <p>I have followin problem:</p>
  
  <p><a href="https://i.stack.imgur.com/2KFsR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2KFsR.png" alt="enter image description here"></a></p>
  
  <p>When I tied to get addons I just get [] but web console show me that I have addons. </p>
  
  <p>My json structure:</p>
  
  <p><a href="https://i.stack.imgur.com/5NGeD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5NGeD.png" alt="enter image description here"></a></p>
  
  <p>I just tried to do this:</p>
  
  <p><code>console.log(vehicle.montage_card.addons);</code> but I have this result: []</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have PrimeNg table, this is little part of this table:</p>
  
  <blockquote>
  <pre><code>      &lt;ng-template let-col let-vehicle="rowData" let-index="rowIndex" pTemplate="editor"&gt;
          &lt;p-multiSelect *ngIf="!viewMode &amp;&amp; (continuationContract == 0)" name="client_vehicles{{index}}" [showToggleAll]="false" [style]="{'width':'100%'}"
            [options]="clientVehiclesOptions" defaultLabel="Open list" [ngModel]="vehicle.assignedContractsID" (ngModelChange)="onSelectedClientVehiclesChange($event, vehicle)"
            maxSelectedLabels=0 selectedItemsLabel="Wybrano: {0}." (onChange)="checkSelectedClientVehiclesQuantity(vehicle)"
            [disabled]="viewMode"&gt;
          &lt;/p-multiSelect&gt;
        &lt;/ng-template&gt;
  </code></pre>
  </blockquote>
  
  <p>And this is my function when I console.log the vehicle:</p>
  
  <pre><code>onSelectedClientVehiclesChange(event: any, vehicle: Vehicle) {
  
  let temp: any[] = [];
  let numberExists: boolean = false;
  console.log("vehicle");
  console.log(vehicle);
  console.log(vehicle.montage_card.addons);
  
  event.forEach(element =&gt; {
    temp.push(this.clientVehicles.client_vehicles.find(clientVehicle =&gt; clientVehicle.id == element));
  });
  }
  </code></pre>