나는 배우에 관한 정보를 담고있는 배우 클래스뿐만 아니라 영화 캐릭터에 관한 json 데이터를 나타내는 Moviecharacter 클래스를 가지고있다. 내가 중복 속성을 사용하지 않고 내 Moviecharacter 클래스로 액터 클래스를 추가 할 :Typescript : 클래스 내의 클래스
// actor class stores general information about an actor in a json file
export class Actor{
name: string;
id: number;
}
// duplicated attributes name and id:
export class MovieCharacter {
name: string;
id: number;
character: string;
}
하지만 난 이런 걸 원하는 : 영화 배우와 MovieCharacter에 대한
내 버전이 있습니다
// without duplicated Attributes:
export class MovieCharacter {
Actor(); // not working
character: string;
}
을 어떤 도움을 주시면 감사하겠습니다.
큰, 상속 내가 찾고 있었던 일이었다 :) – SirCheckmatesalot