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

210
Views
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
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!