I have this element having dynamic id
as it is inside a loop
:
<mat-select multiple class="dw-input" [value]="element.txn_type_id ? element.txn_type_id.split(',') : []" id="field-{{element.Name}}-txn_type_id">
<mat-option *ngFor="let row of txnTypeList" value="{{row.id}}">{{row.name}}</mat-option>
</mat-select>
I am accessing this element in ts
file like this:
document.getElementById('field-' + permissionName + '-txn_type_id');
I am getting the element but there is no value
attribute.
How can i get the selected values for this element.
I could not find any way to do this task using template ref. variable due to the dynamic ids where id's name consist of string value and variable.