Can you not just set $scope.gpgKeys = function() { }; that you define up above?