I use both Bootstrap and AngularJS in my web app. I\'m having some difficulty getting the two to work together.
I have an element, which has the attribute data
There is a solution using $element in the controller if you don't want to create another directive for this problem:
appControllers.controller('YourCtrl', ['$scope', '$timeout', '$element',
function($scope, $timeout, $element) {
$scope.updateTypeahead = function() {
// ... some logic here
$timeout(function() {
$element[0].getElementsByClassName('search-query')[0].focus();
// if you have unique id you can use $window instead of $element:
// $window.document.getElementById('searchText').focus();
});
}
}]);
And this will work with ng-change: