Test request
This commit is contained in:
parent
dad2e1de33
commit
3454c71f05
2 changed files with 13 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* @param {$scope} $scope The $scope service from angular
|
* @param {$scope} $scope The $scope service from angular
|
||||||
*/
|
*/
|
||||||
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', function ($scope, Compute, $rootScope, Loading, Identity)
|
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image)
|
||||||
{
|
{
|
||||||
|
|
||||||
var callMeAfterPullData=function(data){
|
var callMeAfterPullData=function(data){
|
||||||
|
@ -17,7 +17,8 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
|
||||||
Compute.pullData(callMeAfterPullData);
|
Compute.pullData(callMeAfterPullData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Image.getImages(function(){});
|
||||||
|
|
||||||
|
|
||||||
$scope.raiseShowMachineDetailsEvent=function(id){
|
$scope.raiseShowMachineDetailsEvent=function(id){
|
||||||
|
|
|
@ -4,16 +4,22 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){
|
||||||
|
|
||||||
|
|
||||||
var parseUploadImageAnswer=function(response, failedToSendRequest){
|
var parseUploadImageAnswer=function(response, failedToSendRequest){
|
||||||
|
console.log(response.data.Images[0])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var getImages=function(callback){
|
var getImages=function(callback){
|
||||||
|
|
||||||
var result=$http.post('../server/index.php',
|
var result=$http.post('../server/index.php',
|
||||||
$.param({"token" : Identity.profile.token, "task" : "Image"}));
|
$.param({"token" : Identity.getToken(), "task" : "image", 'action':'listImage'}));
|
||||||
|
|
||||||
|
// Wait and handle the response
|
||||||
|
result.then(function (response){
|
||||||
|
callback(parseUploadImageAnswer(response, false));
|
||||||
|
},function(response){
|
||||||
|
callback(parseUploadImageAnswer(response, true));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +27,7 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){
|
||||||
|
|
||||||
// Return services objects
|
// Return services objects
|
||||||
return {
|
return {
|
||||||
uploadImage: uploadImage
|
getImages:getImages
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue