Parent: [798bd2] (diff)

Child: [0765ef] (diff)

Download this file

createAppCtrl.js    26 lines (25 with data), 838 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
/*made by Miguel Rodrigues @ KBZ miguel.rodrigues@knowledgebiz.pt*/
console.log("Defining createAppCtrl");
angular.module('mainApp')
.controller('createAppCtrl', function($scope, $routeParams, $http, appService) {
$scope.appID = null;
$scope.developerid = $routeParams.developerid;
console.log("$routeParams.developerid: " + $routeParams.developerid);
$scope.postdata = function (appID) {
var data = {
appID: appID,
developerID: $routeParams.developerid
};
appService.postApp(data).then(function(response) {
if(response.data.success){
console.log("Post Data Submitted Successfully!");
window.location = "/"+$routeParams.developerid;
}else{
console.log("Something went wrong...");
}
}).then(function(){
console.log("postCreateApp timed out");
});
};
console.log("Loading createAppCtrl");
});