簡單的焦點時,不會在角對焦功能沒有在角
<div class="search pull-right tab-{{ showDetails2 }}" data-ng-click="showDetails2 = !showDetails2; showDetails = false; showDetails1 = false;searchFocus();">
HTML
<input type="text" data-ng-model="model.fedSearchTerm"
placeholder="New Search" required class="span12 fedsearch-box" />
我的函數工作
$scope.searchFocus = function() {
$('.fedsearch-box').focus();
};
http://stackoverflow.com/questions/14833326/how-to-set-focus-in-angularjs看馬克的答案在這裏。 –