只是试图理解打字稿类实例的基本概念我已导入测试模块现在我试图在类上调用该方法,但它不打印任何东西。任何帮助将不胜感激?
main.ts
export class Testbase {
public test(arg: string) {
return arg;
}
}
instance.ts
import {Testbase} from "./main";
export class CallBack {
private testClass: Testbase;
private desc: string = "testing typesceript";
constructor() {
this.testClass = new Testbase();
this.testClass.test(this.desc);
console.log('test');
}
public printStr(str:string) {
this.testClass.test(this.desc);
}
}