In angular 4 .ts i want to use both accounts.Id and accounts.Name from dropdown. can it be possible?
<select [(ngModel)]="selectedName" class="form-control" (change)="SearchLedgerTransaction($event.target.value)">
<option value=""></option>
<option *ngFor="let accounts of accountledger" [value]="accounts.Id && accounts.Name">
{{accounts.Name}}
</option>
</select>
<br />
{{selectedName}} Account Ledger View
you can use something like..
<select [(ngModel)]="selectedName" class="form-control" (change)="SearchLedgerTransaction($event.target.value)">
<option value=""></option>
<option *ngFor="let accounts of accountledger" [value]="accounts">
{{accounts.Name}}
</option>
</select>
<br />
{{selectedName.Id}}{{selectedName.Name}} Account Ledger View