:プロパティXがタイプY上に存在しない、私はそのエラー取得してい
Property 'module' does not exist on type 'Menu'.
Property 'parentId' does not exist on type 'Menu'.
とコードは次のようになります。
private menus: Menu[];
for (var i = 0; i < this.menus.length; i++) {
if ((this.currRoute == "/" + this.ls.actLan + this.menus[i].module) && this.menus[i].parentId !== 0) {
this.IsActive.emit(this.menus[i].parentId);
} else {
this.IsActive.emit(0);
}
}
しかし私はTSファイルことをインポートしている
import { Menu } from './menu';
ここにはこれらのプロパティがあります
export class Menu {
constructor(
id: number,
type: number,
module: any,
urlType: string,
url: string,
name: string,
parentId: any
) { }
}
何が間違っている可能性がありますか?このような
なしが宣言されていないのいずれか' private'それは基本的に を何もしません。宣言するか代入するかは、今は 'Object'には全くプロパティがありません。 –
@NeilLunnありがとう – gsiradze