1
Good morning,
I am trying to popular a table on my system, because the backend done in spring sends me a JSON as follows, an object with several lists inside, example:
{
"contasDespesasQuitadas": [
],
"contasDespesasAbertas": [
],
"contasReceitasQuitadas": [
],
"contasReceitasAbertas": [
]}
On TS, I try to popular the table in the following way:
filtrarDatas() {
if (this.dataInicial && this.dataFinal) {
this.resultadoService.resultByPeriodFinal(this.dataInicial,this.dataFinal)
.subscribe(res => {
this.popularTabelaReceitaAberta(res.contasReceitasAbertas);
this.totalReceitaAberta();
this.popularTabelaReceitaQuitada(res.contasReceitasQuitadas);
this.totalReceitaQuitada();
this.popularTabelaDespesaAberta(res.contasDespesasAbertas);
this.totalDespesaAberta();
this.popularTabelaDespesaQuitada(res.contasDespesasQuitadas);
this.totalDespesaQuitada();
});
}
In the system the table is populated correctly, but the IDE displays an error message:
Property 'countsReceitasAbertas' does not exist on type 'any[]'
This happens in all tables, the error appears after I put "res.accountsReceitsBooks".
It worked by using ". subscribe((res: any) => {"
– Murylo Capucho
Cool man, success there!
– LeAndrade
thanks, success too.
– Murylo Capucho