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

212
Vistas
How to access child interface from parent Interface

Hi I have an interface say

export interface employeeRes {
resource? : employeData,
header?: header
}

export interface employeData {
name: string;
lastname: employeeSub;
}

export interface employeeSub {
middlename: string;
lastname: string;

}

I have these three interface(as example) and in my component file i am calling an api and getting response the response I am getting is of type employeeSub interface

so Is it correct to access the employeeSub interface by this way

employeeRes['resource']['lastname']

and my methods looks like this

getUpdateName() {
this.http.get(url).subscribe((res:employeeRes['resource']['lastname'])=>{
console.log(res);
} 
}

I just want to access interface and assign it to res to specify the type of the response Don't want to make new file for special interface.

thank's for helping

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