I have created a dropdown using angularjs directive. Following is the template I have used
<select ng-model="selected" ui-select2="{allowClear: true, placeholder: placeholder}">' +
'<option value=""></option>' +
'<optgroup ng-repeat="group in Groups" label="{{group.name}}">' +
'<option ng-repeat="value in values" value="{{value.code}}" >{{value.name}}</option>' +
'</optgroup>' +
'</select>
Now, I have a table which has same dropdown values in one of the columns. When a table row is clicked I need to get the value and select the respective value in the dropdown automatically. I was able to fetch values from the row but not sure how to select the clicked option in the dropdown. I have searched around for suggestions but got nothing so far. Please suggest. I have started learning angularjs last week only so pardon me if I am missing something obvious here.