Answer the question
In order to leave comments, you need to log in
Inheritance and TypeScript interface?
I have the following classes, one parent and two others are descendants:
export class ProfileBase implements IProfile {}
export class StaffProfile extends ProfileBase implements IStaff {}
export class PupilProfile extends ProfileBase implements IPupil {}
export class ProfileFactory {
public static set(response: Profile): IProfile {
switch (response.role) {
case 'Teacher':
return new StaffProfile(response);
....
}
Answer the question
In order to leave comments, you need to log in
The problem is that I can't access the methods of the ProfileBase base class through the prepared object.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question