Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function LoginCtrl($scope, $http){
  2.     $scope.panel = 1; //Panel home a 1
  3.  
  4.  
  5.     $scope.login = function(){
  6.         var LoginRO = {
  7.             email : $scope.email,
  8.             password : $scope.password
  9.         }
  10.         $scope.loader = true;
  11.         $.ajax({
  12.             url: '82.245.28.34:8080/api/login',
  13.             type:'POST',
  14.             data: JSON.stringify(LoginRO),
  15.             contentType: 'application/json',
  16.             headers: {'X-ApiKey': 'MasterMarket2014'},
  17.             //complete: callback,
  18.             success: function() {
  19.                 alert("Oh ouiiiiiii ! Enfin c'est magnifique ! Bon ce soir on fais la fête yepa youhou ! ");
  20.             }, error: function(){
  21.                 alert("Ma va fancullo ! Testa di catso !");
  22.             }
  23.         });
  24.     }
  25.  
  26.     httpSuccess = function(response){
  27.  
  28.         $scope.panel = 1;
  29.         $scope.loader = false;
  30.         alert("Bravo connard !")
  31.     }
  32.  
  33.     httpError = function(){
  34.         $scope.loader = false;
  35.         alert("Et bah non ça marche pas fils");
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement