import {TranslateService, LangChangeEvent} from "@ngx-translate/core";
class ExportLanguageFun {
public currentLang : string;
constructor(private translate : TranslateService) {
}
public static setValue(): string {
this.translate
.onLangChange
.subscribe(lang => {
this.currentLang = lang;
})
return this.currentLang;
}
}
导出让 exportLanguage = ExportLanguageFun.setValue(); //错误:“typeof ExportLanguageFun”类型上不存在属性“setValue”。
预期输出 console.log(let+"someValue");