Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Tab键未捕获,请单击_Html_Angularjs - Fatal编程技术网

Html Tab键未捕获,请单击

Html Tab键未捕获,请单击,html,angularjs,Html,Angularjs,我是Angularjs新手,我使用的是ng click选项,但当我按下键盘上的tab键时,ng click没有捕获。tab键仅捕获Href,如何启用tab键来捕获ng click <th><a href="#/providerSearch" class="nameCross"><img src="img/cross.png" ng-click="goBack()"></a>{{firstName}} {{lastName}}</th>

我是Angularjs新手,我使用的是ng click选项,但当我按下键盘上的tab键时,ng click没有捕获。tab键仅捕获Href,如何启用tab键来捕获ng click

<th><a href="#/providerSearch" class="nameCross"><img src="img/cross.png" ng-click="goBack()"></a>{{firstName}} {{lastName}}</th>
                    <th>{{licNum}}</th>
                    <th>{{city}}</th>
                    <th>{{stCode}}</th>
                    <th>In Network</th>
                    <th>{{specialty}}</th>
                    <th>{{phone}}</th>
                    <th>{{tin}}</th>
                    <th class="smallWidth noteIcon" ng-click="fetchPrvdNts()" ><div ng-show="count>0" class="countBuble">{{count}}</div></th>
                    <th class="smallWidth moreDetails" ng-click="showMoreDtls()" ng-class="{open:!showDetailsBlock , close:showDetailsBlock}">More</th>
{{firstName}{{lastName}
{{licNum}}
{{城市}
{{stCode}}
在网络中
{{专业}}
{{phone}}
{{tin}}
{{count}}
更多
按Tab键将焦点放在第一个href行上,但在按Tab键后,没有捕获{{count}的ng click功能。有人能帮我一下吗

使用属性控制什么元素在按Tab键时获得焦点。但是,如果您的目标是允许使用tab导航到可单击的元素,然后能够使用Enter或类似的命令触发操作,则还需要使controller侦听键盘事件,以及单击。您可以这样做:

HTML:

能做得简单些吗


演示实验:谢谢,我们不能给出选项卡索引,因为我们不知道我们深入使用的所有功能,假设如果我们点击一个链接,它将显示一个带有特定按钮的下拉菜单,如果我们给出选项卡索引,如果我们点击该链接,我们无法捕获下拉菜单中的按钮,因此我们无法硬编码选项卡索引,如果有其他解决此问题的方法,请提供帮助
<a href="#" tabindex="1">Link</a>
<span ng-keypress="test($event)" ng-click="test()" tabindex="2">Test</span>
$scope.test = function(e) {
    if ((e && e.keyCode === 13) || typeof e === 'undefined') {
        alert('test');
    }
};