Created
May 22, 2014 19:48
-
-
Save christianrojas/829508e9158e44a50096 to your computer and use it in GitHub Desktop.
feedback-angularjs-error.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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