In my controller i have methods
- $scope.openJukeboxesModalToGroup -- open modal popup
- $scope.searchJukeboxes --- to search on the page
- $scope.keyPressed -- capture the key pressing
In the partial with a form
<form class="form-inline" role="form" ng-submit="deadForm()"> <div class="form-group"> <button ng-click="openJukeboxesModalToGroup()" class="btn btn-info">Add Stores to Group</button> </div> <div class="form-group"> <input type="text" ng-model="jukeboxFilter" ng-keypress="keyPressed($event, 'search')" class="form-control" placeholder="search"> </div> <button type="button" ng-click="searchJukeboxes()" class="btn btn-info"><span class="glyphicon glyphicon-search"></span></button> <button type="button" ng-click="resetFilter()" class="btn btn-info"><span class="glyphicon glyphicon-repeat"></span></button> </form> keyPressed method is
$scope.keyPressed = function($event, eventType) { $event.stopImmediatePropagation(); if(eventType=='search') { if($event.which==13) { $scope.searchJukeboxes(); } } }; I am trying to start the search whenever ever somebody types something in the text bar and clicks enter. But i don't somehow the openJukeboxesModalToGroup() method is called too. I have tried to stop this by calling stop event proprpagation, changing name of openJukeboxesModalToGroup() method. But nothing is working. Any help on this.
deadForm() method is impleament and i am not getting any error in chrome console.