37 lines
843 B
JavaScript
37 lines
843 B
JavaScript
'use strict';
|
|
|
|
angular.module('warehost')
|
|
.controller('SignupHostCtrl',function(session,config,alert,$scope,$http){
|
|
$scope.status = false;
|
|
$scope.profil = {};
|
|
$scope.obj = {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.obj.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);
|
|
});
|
|
}
|
|
};
|
|
load();
|
|
|
|
});
|