Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     app.controller('FormController', function($scope, $http) {
  3.         $scope.user = {
  4.             login:"Darlok",
  5.             password:"2009"
  6.         };
  7.  
  8.         $scope.processForm = function() {
  9.             console.log($.param($scope.user));
  10.            
  11.             $http({
  12.                 method: 'POST',
  13.                 url: 'http://localhost:8080/user/login',
  14.                 data: $.param($scope.user),
  15.                 headers : {'Content-Type': 'application/x-www-form-urlencoded'}
  16.             })
  17.             .then(function successCallback(response) {
  18.  
  19.             }, function errorCallback(response) {
  20.  
  21.             });
  22.         };
  23.     });
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement