以下のAPIの型の定義を①のようにしました。
storeを作成し、②の値をstoreに保存しようと思ったのですが、プロパティ 'select' は型 'Teams' に存在しません。tsというエラーが出てしまいます。
わかる人いましたらご教授お願いしたいです。
// store export class GroupEntity { teams: Tesams = '' constructor(teams: Teams) { this.teams.group.type = teams.group.type this.teams.group.status.id = teams.group.status.id } }
① export class Teams { group = new Group() } export class Group { type: number = '' status = new Select() } export class Select { id: number = 0 name: string = '' }
② teams : [ { "group": [ { "type": "member", "status": { "select": [ { "id": 0, "name": "グループA", }, { "id": 1, "name": "グループB", }, ] } } ] }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。