问题
In my AngularJS app, I need to create something similar to jQuery modal form Dialog to get username from user.
I have used twitter-bootstrap modal and AngularUI dialog . Both of which fall short on two things:
- Not able to get auto-focus on
username
textbox inside the modal whenever modal opens. - Not able to submit username on press of enter button.
Here is PLUNKER of my earlier failed attempt with twitter-bootstrap. Now, I am looking to see if there is already some directive exists which meets my 1 and 2 specific need.
回答1:
I got 1
working through alternate solution
Why focus on textbox is not set inside a twitter-bootstrap modal (popup) by AngularJS
来源:https://stackoverflow.com/questions/17661176/how-to-create-angularjs-directive-to-get-jquery-dialog-with-submit-on-press-of-e