Advertisement
Guest User

Untitled

a guest
Mar 29th, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function PostCtrl($scope, $element, $http, $templateCache) {
  2. $scope.method = 'POST';
  3. $scope.url = 'url.php';
  4. $scope.codeStatus = "";
  5. var FormData = { 'name' : document.f1.name.value, 'password' : document.f1.password.value };
  6.  
  7. $scope.add = function() {
  8.  
  9. $http({method: $scope.method, data: FormData, url: $scope.url, headers: {'Content-Type': 'application/x-www-form-urlencoded'}, cache: $templateCache}).
  10. success(function(response) {
  11. $scope.codeStatus = response.data;
  12. }).
  13. error(function(response) {
  14. $scope.codeStatus = response || "Request failed";
  15. });
  16. return false;
  17. };
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement