$scope.$watch("showFon", function(newValue, oldValue){
if(newValue == true){
angular.element($window).bind("keydown", function(e){
console.log(e.keyCode);
if(e.keyCode == 27){
$scope.showFon = false;
$scope.$digest();
}
});
}else{
angular.element($window).unbind("keydown");
}
});