I've implemented a drop down list on a project I'm working on using AngularJS.
The HTML snippet is as follows:
<input-multiselect [list]="transactionState" placeholder="Choose Your Transaction State">
<ng-container class="c-legend">Transaction status</ng-container>
</input-multiselect>
I'm using an array and a switch case to store the values that are needed in the drop down for a few different cases.
The JS code is below:
export class SearchPageComponent implements OnInit {
transactionState: Array<any>;
setTransactionDropdown() {
switch (this.userGroup) {
case 5:
this.transactionState = [
{ value: 'READY_INV', label: 'Ready for Invites' },
{ value: 'NOT_READY_INV', label: 'Not Ready for Invites' },
];
break;
}
}
What I want to do is have a function that can access this.transactionState
and get the values that have been selected, so that I can pass these values on to another function.
Can anyone help me with this please? Is there a better method I could have used?
Thanks in advance!