/*made by Miguel Rodrigues @ KBZ miguel.rodrigues@knowledgebiz.pt*/
console.log("Defining appCtrl");
angular.module('mainApp')
//this is the controller responsible for handling developer id request
.controller('appCtrl', function($scope, $http, appService) {
$scope.appID = null;
$scope.developerID = null;
$scope.postdata = function (appID, developerID) {
var data = {
appID: appID,
developerID: developerID
};
appService.postApp(data).then(function(response) {
if(response.data.success){
console.log("Post Data Submitted Successfully!");
window.location = "/"+developerID;
}else{
console.log("Something went wrong...");
}
}).then(function(){
console.log("postApp timed out");
});
};
console.log("Loading appCtrl");
});