0
I have an array inside an object, I would like to know how to separate the items service_name and service_value. I don’t know if there’s a way to do this in html itself...
pedido{id_pedido:"17",
id_usuario:"34",
nome_servico:"Servico 01,Servico 02,Servico 03"
valor_servico:"250,200,380",
total_servico:"830"}
<div *ngFor="let item of pedido">
<div>{{item.nome_servico}}</div>
<div>{{item.valor_servico}}</div>
</div>
In this case just call in the HTML itself:
pedido.nome_servico
.– Diego Souza
Won’t work the
for
since the object has only one group of values.– Diego Souza
@Diegosouza, the problem is that in html everything comes together 250,200,380
– Henrique Mendes Silveira Rodri
Ahhh. But where do these values come from?
– Diego Souza
as well as an object as shown there...
– Henrique Mendes Silveira Rodri
So, but it would be interesting to come from the right bank already for you to use in
for
as an object. So you would have a lot of work.– Diego Souza
I know, but then I get into a saving problem, which I already did, so I’m trying this way...
– Henrique Mendes Silveira Rodri
And how you wanted to show this data?
– Diego Souza
Separate, type like this:
– Henrique Mendes Silveira Rodri
Servico 01 - 200 Servico 02 - 250 Servico 03 - 380
– Henrique Mendes Silveira Rodri