Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

218
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda