My function is triggered when the value of a textarea changes, however, it does not work when the spacebar is pressed. Is there a way to make it work for spacebars as well? I want the function to be called whenever the content changes, regardless of the key pressed.
I have included a link to a fiddle with the code. In the example, you can see that the $scope.log
array does not add a new element when the spacebar (or enter key) is pressed, but it does with any other key that is not whitespace.
Check out the sample fiddle here: http://jsfiddle.net/UJWLN/4/