angularjs - Unable to get property 'target' of undefined or null reference -


i have in controller :

 $scope.searchonenter = function (event) {             var element = angular.element(event.target);             if (event.keycode === 13) {                 _search(element.val());             }          } 

in html have this:

 <input type="search" data-ng-model="searchtext" data-ng-model-options="{ debounce: 1000 }" placeholder="@translator.translate("search_offer")" data-ng-keydown="checkkeydown($event);searchponenter($event)" data-ng-change="search()" data-ng-enter="searchonenter(searchtext)" /> 

but in console im geting error:

unable property 'target' of undefined or null reference

check demo: jsfiddle.

it works expected. jsfiddle doesn't work because not import angularjs correctly. need add ng-app="myapp":

<div ng-app="myapp" ng-controller="myctrl"> 

Comments

Popular posts from this blog

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -