Download this file

appCtrl.js    27 lines (25 with data), 817 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*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");
});