javascript - ng-submit is not working when enter key is pressed from focused input -
for reason, when push enter after un-hiding input, submit_form()
function not run. have ideas on why wouldn't work?
<form name="theform" ng-submit="submit_form()" novalidate> <div ng-hide="show_form"> <div ng-click="show_input()">click me</div> </div> <div ng-show="show_form"> <input type="text" class="md_input" ng-model="inputstuff" placeholder="name" required /> </div> </form>
inside controller:
$scope.show_form = false; $scope.show_input = function() { $scope.show_form = true; } $scope.submit_form = function() { console.log("trigger"); }
Comments
Post a Comment