admin管理员组

文章数量:1291716

On mat-select value change, want to pass some flag to another column or want to add custom content next column of same row using angular.

                  <mat-select style="min-width: 150px;" 
                    [(ngModel)]="data.selected_value" 
                    name="configtableDropdown"
                    (selectionChange)="selection($event, data)">
                      <mat-option *ngFor="let dropdownValue of data.values" [value]="dropdownValue">
                        {{dropdownValue}}
                      </mat-option>
                  </mat-select>
                </mat-form-field>

On mat-select value change, want to pass some flag to another column or want to add custom content next column of same row using angular.

                  <mat-select style="min-width: 150px;" 
                    [(ngModel)]="data.selected_value" 
                    name="configtableDropdown"
                    (selectionChange)="selection($event, data)">
                      <mat-option *ngFor="let dropdownValue of data.values" [value]="dropdownValue">
                        {{dropdownValue}}
                      </mat-option>
                  </mat-select>
                </mat-form-field>
Share Improve this question edited Feb 14 at 6:01 Rohit asked Feb 13 at 13:40 RohitRohit 311 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Whatever you want to add add in the data object data, assume the property name is someFlag, now in the next column, you can reference data.someFlag and conditionally show content.

@if(data.someFlag) {
 true value HTML
} @else {
 false value HTML
}

本文标签: