Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
AngularJS/JavaScript - How to rename an array key name

I have an application that reads an excel file, and displays its contents in an html table.

These elements are in an array called "AgendaItems".

There are 2 files the user can read, each is formatted with some differences. Both have 3 columns.

File 1: AgendaItem, LegistarId, Title File 2: Agenda #, File #, Title

I am able to read the file and populate the array $scope.AgendaItens with the contents of either file, depending what the user selects.

My problem is that before making these modifications to accept a second file with a different format, I used:

<td scope="row">{{ai.AgendaItem}}</td>
<td>{{ai.LegistarID}}</td>

When processing the new file, now the array contains: Agenda #, and File #, which are equivalent to AgendaItem, and LegistarID respectively.

Is there a way to, in the HTML choose which value to display? for example, if array has AgendaItem, display AgendaItem, if array has Agenda #, display Agenda #?

Or, is it possible to rename a the name of a key, from Agenda # to AgendaItem and from File # to LegistarID?

Please let me know if I need to post more details, more code in order for me to be able to get help.

Thank you in advance, Erasmo

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda