我現在有一個根據JSON檔案,ngFor出來的動態內容
已經可以順利讀出來和存入整個JSON
但是卡在如何把值設定到畫面上的部分
再麻煩各位大神了,感謝
HTML
<ng-container *ngFor="let aa of this.KycQuestionObj; let i = index">
<mat-radio-group aria-label="Select an option">
<ng-container *ngFor="let cc of aa.counterkycs; let k = index">
<mat-radio-button
[value]="k + 1"
(change)="KYCradioJSONChange($event, cc, k, 'sele1Note')"
>
<div>
<p>{{ cc.sele1Note }}</p>
</div>
</mat-radio-button>
</ng-container>
</mat-radio-group>
JSON結構如下
答案存放在
"ans1Text"的欄位
{
"message": "string",
"isSuccess": true,
"counterKyc1Data": {
"idno": "string",
"openbranchcode": "string",
"counterkycq": [
{
"id": 0,
"itemNo": "string",
"qustNo": "string",
"qustText": "string",
"multiCheck": "string",
"scoreAmt": 0,
"counterkycs": [
{
"id": 0,
"itemNo": "string",
"qustNo": "string",
"ansNo": "string",
"aGupNo": "string",
"aMulti": "string",
"sele1Note": "string",
"ans1Text": "string",
"score": 0,
}
],
"createdBy": "string",
"createdDate": "2021-02-17T02:07:37.603Z",
"updatedBy": "string",
"updatedDate": "2021-02-17T02:07:37.603Z"
}
]
}
}