I have a JSON in this format:
[
{
"agencia": "2342342",
"digito_agencia": "2342",
"numero_conta": "234234",
"digito_conta": "23423",
"_id": "5bff1a63a617f53414766c27",
"createdAt": "2018-11-28T22:44:51.567Z",
"updatedAt": "2018-11-28T22:44:51.574Z",
"__v": 0,
"bancos": {
"nome_banco": "001 - BANCO DO BRASIL S/A",
"_id": "5bf2eb4bc3910712f4604847",
"id": "5bf2eb4bc3910712f4604847",
"updatedAt": "2018-11-28T22:42:11.276Z",
"contasJogador": "5bff0c013efde3235465a39f",
"nome_do_banco": "5bff0dc1d40d01202418df4b",
"contasjogador": [
"5bff18eed8d38e1e7c99e83a"
]
},
"id": "5bff1a63a617f53414766c27",
"jogador": {
"nome": "Ramos Janones",
"email": "[email protected]",
"cpf": "03472925698",
"celular": "34996320391",
"telefone": "",
"cep": "38300070",
"endereco": "DEZESSEIS",
"cidade": "Ituiutaba",
"estado": "Minas Gerais",
"bairro": "",
"complemento": "",
"usuario": "ramos",
"senha": "teste123",
"idppoker": "",
"nickppocker": "ramosinfo",
"numero": "",
"_id": "5bf18c512af2e61ab879d2f7",
"createdAt": "2018-11-18T15:59:13.735Z",
"updatedAt": "2018-11-26T15:41:00.806Z",
"__v": 0,
"id": "5bf18c512af2e61ab879d2f7",
"foto": null,
"contasJogadors": null
},
"tipocontas": {
"tipo_conta": "Conta Poupança",
"_id": "5bff19328ff184285c7131df",
"createdAt": "2018-11-28T22:39:46.676Z",
"updatedAt": "2018-11-28T22:42:11.275Z",
"__v": 0,
"id": "5bff19328ff184285c7131df",
"contasjogador": [
"5bff18eed8d38e1e7c99e83a"
]
}
}
]
I need to get this data when the id of "jogador"
is equal to the past, in this case the above JSON would be "id": "5bff19328ff184285c7131df"
.
My service I have:
query(): Observable<any> {
const id = localStorage.getItem('ref');
return this.http.get(this.baseUrl, ${id});
}
Where localStorage.getItem('ref')
is the player id stored in localStorage
.
How do I get only the id of "jogador"
as a filter in this array to play in *ngFor
of the View?