I had a similar problem and I never thought about how to access typeahead select(idx) , but I managed to get this functionality to work. Here is my hacky workaround ....
$promise.then(function(res) { angular.forEach(res, function(item, key) { // if we have an exact match if (item.title === term) { // update model $scope.src = item; // find item in dropdown var elm = '[id*=option-' + key + ']'; var opt = angular.element(document.querySelectorAll(elm)); //call click handler outside of digest loop $timeout(function() { opt.triggerHandler('click'); }, 0); } }); // return async results return res; });
Basically we just update our model manually, find the item in our drop-down list, and then run the 'click' handler. Make sure you end the call to triggerHandler in $timeout() zero, otherwise you will get the error $rootScope:inprog , since the digest is already running.
source share