[英]How can I set .focus() on a custom directive in AngularJs?
Fairly new to javascript. javascript新手。 I was wondering with the following tag, besides having to manually put in Ids, is there a way to set .focus() to the container (custom directive)?
我想知道以下标记,除了必须手动输入Ids外,还有没有办法将.focus()设置为容器(自定义指令)? The custom directive is a container div that acts as a tile.
custom指令是一个充当切片的容器div。
<tile class="ng-scope gridster-item" tilevalue="1" gridster-item="tile" row="0" col = "0" ng-repeat="tile in selectedTiles"> </tile>
You'll need a focus attribute directive. 您将需要一个focus属性指令。 eg
例如
<tile class="ng-scope gridster-item" focus-directive tilevalue="1" gridster-item="tile" row="0" col = "0" ng-repeat="tile in selectedTiles"></tile>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.