TSlint(v3.15.1)とtypescript(2.0.3)の最新バージョンを使用して、より古い.ts
ファイルを更新しています。私は私が解決しようとしているいくつかのエラーを取得しています。Typescriptで変数の有無を確認してください
export class myClass {
private pUserName: string;
private pUserPass: string;
private pHost: string;
private pPort: number;
constructor($host: string, $port: number) {
this.pHost = $host;
this.pPort = $port;
}
public isReady(): boolean {
return Boolean(this.pUserName && this.pUserPass && this.pJiraHost && this.pJiraPort);
}
どちらか私は取得しています「[TS]は名前のブールを見つけることができない」、またはいくつかは、「ブール値への文字列を変換することはできません」...:
のコードでは、いくつかのクラスのプロパティのための単純な存在テストです
私は非常にタミル文字に慣れていますが、これを正しく書く方法を教えてください。
あなたは '復帰!!で行くことができます(この.pUserName && this.pUserPass && this.pJiraHost && this.pJiraPort);空の文字列とゼロも注意して 'false'として報告されます –