Skip to content

Instantly share code, notes, and snippets.

@christianrojas
Created May 22, 2014 19:48
Show Gist options
  • Save christianrojas/829508e9158e44a50096 to your computer and use it in GitHub Desktop.
Save christianrojas/829508e9158e44a50096 to your computer and use it in GitHub Desktop.
feedback-angularjs-error.js
cbulz.controller("FeedbackController", ["$scope", 'Feedback', function($scope, Feedback){
$scope.create = function(){
var session = new Feedback({
feedback: $scope.feedback
});
session.$save($scope.success, $scope.error)
};
$scope.success = function(response, responseHeader){
console.log('Success')
};
$scope.error = function(response){
console.log('Error')
};
$scope.resetErrors = function(response){
$scope.controls.errors = []
};
$scope.reset = function(){
$scope.feedback = {};
$scope.sent = false;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment