在这种特殊情况下,我必须使这些输入调用一个函数,当我按Enter键什么选项?
@H_502_4@// HTML view // <form> <input type="text" ng-model="name" <!-- Press ENTER and call myFunc --> /> <br /> <input type="text" ng-model="email" <!-- Press ENTER and call myFunc --> /> </form> // Controller // .controller('mycontroller',['$scope',function($scope) { $scope.name = ''; $scope.email = ''; // Function to be called when pressing ENTER $scope.myFunc = function() { alert('Submitted'); }; }])