0
インターフェイスの型のようなクラスを使用できますか?例えば、私はクラスの動物を持って、私のようなものを使用することができます:私はこのような状況でエラーエン持っクラスはTypescriptのインターフェイスの型のようです
interface I {
object: Animal
}
を:
class A {
public static foo(text: string): string {
return text;
}
}
interface IA {
testProp: A;
otherProp: any;
}
class B {
constructor(prop: IA) {
console.log(prop.otherProp);
console.log(prop.testProp.foo('hello!'));
}
}
TS2339:プロパティ「fooが」オン存在しません。タイプ 'A'
は、この作品をありがとう:あなたのケースで
–