我有一些用于 CRUD API 服务类的类,我想扩展它,但为了考试而放弃了一些属性,这是我的类
class Parent {
public propertyToKeep: any;
public propertyToDelete: any;
constructor() { }
}
Run Code Online (Sandbox Code Playgroud)
这是儿童班
class Child extends Parent {
constructor() {
super();
}
}
Run Code Online (Sandbox Code Playgroud)
我不想查看和访问的另一个文件
export class comeComponent {
constructor(private child: Child) {
this.child.propertyToKeep // work
this.child.propertyToDelete // error and I can't even see it
}
}
Run Code Online (Sandbox Code Playgroud)