TypeError error occurred: list.map is not a function

0

I get the error described in the title in this situation:

carregarCategorias() {
    this.itemService.listarCategorias().then(lista => {
      this.categorias = lista.map(categoria => ({ label: categoria.descricao, value: categoria.id }));
    })
    .catch(erro => this.errorHandler.handle(erro));
  }

Does anyone have any tips?

    
asked by anonymous 04.08.2018 / 16:33

0 answers