ng-keypress not triggering function
i tried the same things and its working
<body ng-controller="MainCtrl"> <input ng-keypress="change($event)" type="text" > <pre>{{name}}</pre> </body>app.controller('MainCtrl', function($scope) { $scope.name = 'World'; $scope.change=function($event){ $scope.name= 'hello'; };});
checkout this plunker... PLUNKER LINK
EDITcheckout your code plunker.. thats also working
EDIT
finally the answer is: 1.0.7 does not support ng-keypress, hence it was not working..
As everyone else says it's working as it is supposed to do. Perhaps you want something like this?
var myApp = angular.module('myApp', []);myApp.controller('MainCtrl', ['$scope', function ($scope) { $scope.text = ''; $scope.change=function($event){ $scope.text += String.fromCharCode($event.keyCode); };}]);