I am programming in Angular and just want to give the opportunity to click on button per row and per column. How can you do this?
This is the code I already have:
component.html:
<div class="kan1FuerLinks">
<div class="kan1" *ngFor="let test of tests; let i = index">
<a>{{test}}</a>
<mat-radio-group >
<mat-radio-button (click)="getValue(i, 1)" value="1" [disabled]="arrayValue[i][1]">1</mat-radio-button>
<mat-radio-button (click)="getValue(i, 2)" value="2" [disabled]="arrayValue[i][2]">2</mat-radio-button>
<mat-radio-button (click)="getValue(i, 3)" value="3" [disabled]="arrayValue[i][3]">3</mat-radio-button>
<mat-radio-button (click)="getValue(i, 4)" value="4" [disabled]="arrayValue[i][4]">4</mat-radio-button>
<mat-radio-button (click)="getValue(i, 5)" value="5" [disabled]="arrayValue[i][5]">5</mat-radio-button>
<mat-radio-button (click)="getValue(i, 6)" value="6" [disabled]="arrayValue[i][6]">6</mat-radio-button>
</mat-radio-group>
{{buttonValue}}
</div>
component.ts:
getValue(getI: number, val: number) {
this.buttonValue[getI][val] = val;
for (let i = 0; i < this.tests.length; i++) {
for (let j = 0; j < 6; j++ ) {
if (this.buttonValue[getI][j] === this.buttonValue[i][j] && this.buttonValue[getI] !== this.buttonValue[getI]) {
this.arrayValue[getI][val] = true;
} else {
}
}
}
}
It does not work. Please help me.
抱歉,您的英语不是蛋上的黄色,所以我不明白您的问题,请您重复一遍;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.