将默认焦点放在AngularJS中的元素上的最简单方法是什么? [英] What is the easiest way to put a default focus on an element in AngularJS?
本文介绍了将默认焦点放在AngularJS中的元素上的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个模态对话框中加载的模板,上面有一个我想重点介绍的输入文本.最简单,最有角度的方法是什么?
I have a template that is loaded in a modal dialog, there is a single input text on it which I would like to have a focus on. What is the easiest and the Angular way of doing that?
更新:
推荐答案
Depending on the browser(s) you need to support you could use input autofocus attribute.
在此处中查看plunker.
See plunker here.
Or if this is not an option and has mentioned by Mark you can refer to the following stackoverflow response.
这篇关于将默认焦点放在AngularJS中的元素上的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文