This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
2016-12-07 21:33:51 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('warehost')
|
|
|
|
.controller('SignupHostCtrl',function(session,config,alert,$scope,$http){
|
|
|
|
$scope.status = false;
|
|
|
|
$scope.profil = {};
|
|
|
|
$scope.agb = false;
|
|
|
|
alert.set({});
|
|
|
|
function load(){
|
|
|
|
$http.get(config.api+'/host/profil').then(function(res){
|
|
|
|
$scope.profil = res.data.data;
|
|
|
|
$http.get(config.api+'/host/signup').then(function(res){
|
|
|
|
session.set(res);
|
|
|
|
alert.set(res);
|
|
|
|
$scope.status = res.data.data;
|
|
|
|
},function(res){
|
|
|
|
session.set(res);
|
|
|
|
alert.set(res);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$scope.signup = function(){
|
|
|
|
if($scope.agb){
|
|
|
|
$http.post(config.api+'/host/signup').then(function(res){
|
|
|
|
session.set(res);
|
|
|
|
alert.set(res);
|
|
|
|
$scope.status = res.data.data;
|
|
|
|
},function(res){
|
|
|
|
session.set(res);
|
|
|
|
alert.set(res);
|
|
|
|
});
|
|
|
|
}
|
2016-12-07 21:36:35 +01:00
|
|
|
};
|
2016-12-07 21:33:51 +01:00
|
|
|
load();
|
|
|
|
|
|
|
|
});
|