I am trying to fire keypress event anytime and anywhere I hit enter, but I only can reach this in specifying in a DOM element with ng-keypress.
I reached this result using pure javascript with this code:
document.onkeydown = function(e){
if(e.keyCode === 13){
//do something
}
}
But I am not sure if this is the best way, or the "angular way" to do this.