Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
53
rated 0 times [  58] [ 5]  / answers: 1 / hits: 29644  / 10 Years ago, thu, november 20, 2014, 12:00:00

is there a way to trigger event when clicking on ENTER key in the input field?
I found a directive that someone suggested to use, but I wonder if there is a simple way to do it.



I am using angular 1.3.


More From » html

 Answers
23
 $timeout(function() {
angular.element('#myselector').trigger('click');
}, 100);


If you want trigger on press on enter key you need to write like that



<input ng-keyup=$event.keyCode == 13 ? myFunc() : null>

[#68750] Tuesday, November 18, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madelyn

Total Points: 449
Total Questions: 100
Total Answers: 100

Location: Seychelles
Member since Fri, May 7, 2021
3 Years ago
madelyn questions
Wed, Jul 28, 21, 00:00, 3 Years ago
Wed, Jul 14, 21, 00:00, 3 Years ago
Sat, Nov 7, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;