Rohit
Rohit

Reputation: 31

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

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.

On change on dropdown value, need to add "Modified column" in next column as shown in image. below are the code also.

                  <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>

Upvotes: 1

Views: 47

Answers (1)

Naren Murali
Naren Murali

Reputation: 57986

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
}

Upvotes: 0

Related Questions