i had same problem and finally i'm create my own directive:
angular.module('openselect', [])
.directive('openselect', function () {
var showDropdown = function (element) {
var event;
event = document.createEvent('MouseEvents');
event.initMouseEvent('mousedown', true, true, window);
element.dispatchEvent(event);
};
return {
restrict: 'A',
scope: {
'elemento': '@'
},
link: function (scope, elem, attrs, ctrl) {
elem.bind('click', function () {
var elemento = document.getElementById(scope.elemento);
showDropdown(elemento);
});
}
};
});
To use:
<div style="position:relative">
<span ng-show="submittedForm.contry.$error.required && co_form.contry.$error.required" class="label label-danger">Indicanos tu país</span>
<select name="country" class="form-control input-md" ng-model="formCheckout.country" id="myCountry" placeholder="España" required>
<option value="6" selected="selected">España</option>
<option value="1">Alemania</option>
<option value="15">Portugal</option>
</select>
<span class="glyphicon glyphicon-chevron-down" style="position: absolute; right: 10px; color: #A6A6A6; top: 18px;" openselect elemento="myCountry"></span>
Adds directive to any tag passing id of select (elemento) that you want to open.
You can see the very basic javscript code inside directive if you want to use in other context;
hope it helps ;D