выберите выбранное значение в ngfor - PullRequest
0 голосов
/ 04 марта 2020

Я хотел бы получить статус в параметрах, которые находятся в ngfor и месте, выбранном в соответствии с параметром = статус, я исследовал и пробовал, но не могу получить его

Я бы очень хотел признателен за любую помощь enter image description here

userDocument:
    approver1: {user: null, status: 0}
    approver2: {user: null, status: 0}
    approver3: {user: null, status: 0}


<table *ngIf="role !='student' && userId" class="table table-bordered">
            <thead>
                <tr>
                    <th>Form Name</th>
                    <th>Documents Status</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let document of data">
                    <td>{{document.document}}</td>
                    <td>                    
                        <div *ngIf="document.userDocument">
                            <div *ngFor="let key of Object.keys(document.userDocument); let i=index">
                                <div *ngIf="i<document.approvers">
                                    <nb-select fullWidth placeholder="Approver {{i+1}}">                                
                                        <nb-option value="0">No</nb-option>
                                        <nb-option value="1">Yes</nb-option>
                                    </nb-select>
                                </div>
                            </div>
                        </div>
                        <p *ngIf="!document.userDocument">Has no document</p>
                    </td>
                </tr>
            </tbody>

        </table>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...