View difference between Paste ID: m9dBAjJF and pFAW1uzp
SHOW: | | - or go back to the newest paste.
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-
            type:"POST",
12+
            type:'POST',
13-
	    headers: { 'X-ApiKey': 'MasterMarket2014',
13+
	    contentType:'application/json;charset=UTF-8',
14-
		       'Content-Type': 'application/json;charset=UTF-8' }
14+
	    dataType:'json',
15-
            url: "http://82.245.28.34:8080/api/login",
15+
	    headers: { 'X-ApiKey': 'MasterMarket2014'}
16
            url: 'http://82.245.28.34:8080/api/login',
17
            data: JSON.stringify(LoginRO),
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 ! ");
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
}