Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Interfaz mecanografiada: agregue un nuevo valor dinámicamente o cree la interfaz dinámicamente

Tengo una tabla de material angular. Obviamente, tengo una interfaz desde la cual se crea la fuente de datos para la tabla. ¿Hay alguna posibilidad de agregar un nuevo valor dinámicamente en la interfaz o al menos crear la interfaz dinámicamente? Porque los datos que provienen del backend son desconocidos. Ejemplo: de esto:

 export interface PeriodicElement { name: string; position: number; weight: number; symbol: string; }

a esto:

 export interface PeriodicElement { name: string; position: number; weight: number; symbol: string; index: number; }

o de esto:

 export interface PeriodicElement {}

a esto:

 export interface PeriodicElement { name: string; position: number; weight: number; symbol: string; index: number; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. Será mejor usarlo como,
 export interface PeriodicElement { name: string; position: number; weight: number; symbol: string; [key: string]: string | number; }

o solo

 export interface PeriodicElement { [key: string]: string | number; }
  1. De lo contrario, puede crear modelos separados y usar el operador union( | ) .

  2. También puedes usar Parciales para lograr esto.

  3. Para crear dinámicamente Consulte aquí

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!