Skip to content

Instantly share code, notes, and snippets.

@mgosk
Created August 14, 2014 17:57
Show Gist options
  • Save mgosk/92a6f70e6953c5cf500f to your computer and use it in GitHub Desktop.
Save mgosk/92a6f70e6953c5cf500f to your computer and use it in GitHub Desktop.
hashExApp.controller("AlertCtrl", ['$scope', 'notificationService', function($scope, notificationService) {
$scope.addSuccessAlert = function (msg) {
notificationService.success(msg)
};
$scope.addErrorAlert = function (msg) {
notificationService.error(msg)
};
$scope.standardErrorCallback = function (data, status) {
if (data == "")
$scope.addErrorAlert(Messages('criticalFailure'));
else
$scope.addErrorAlert(data)
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment