Skip to content

Instantly share code, notes, and snippets.

@projectweekend
Last active December 28, 2015 14:29
Show Gist options
  • Save projectweekend/7515180 to your computer and use it in GitHub Desktop.
Save projectweekend/7515180 to your computer and use it in GitHub Desktop.
AngularJS ERROR helper service - A pattern that I am testing out to easily inject some basic error handling into controller functions.
factory('ErrorHelper', function() {
return {
errorMessage: "",
dismissError: function () {
this.errorMessage = "";
},
logToConsole: function (data) {
console.log("ERROR:");
console.log(data);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment