1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to add object values from an array of multiple objects into an array readable for ngFor?

Discussão em 'Angular' iniciado por Hoonin, Outubro 16, 2024 às 02:42.

  1. Hoonin

    Hoonin Guest

    I get an array like this:

    obj_Array = [{"Information":{ID: 1, Name: "Frank"}},"Route":{Direction: "north", Time: 10:50:24},"Music":{volume: "loud", input: "3.5mm"}];


    I need to take the object values from Information, Route, and Music: 1, Frank, north, 10:50:24 etc... And save them into an array that is readable for Angular front-end ngFor. So I can print the values to the screen using Angular Material Table.

    Currently says the array is an object and cannot iterate through it. But when I do .isArray() it prints true.

    I want an end product like the below Array:

    String_Array = ["1","Frank","north","10:50:24","loud","3.5mm"];


    This now should be easily read by ngFor for it to be displayed.

    Continue reading...

Compartilhe esta Página