I have a text box and button,onclick of the button I am calling a function after writing some text in text box.I need to call same function on press enter key also.Here is the code below.
html
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<input type="text">
<button ng-click="myFunct()" type="button">click</button>
</div>
script
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope,$http) {
$scope.myFunct = function() {
alert('I am an alert');
}
});