test
This commit is contained in:
parent
3b569b6d00
commit
8ad216dedf
4 changed files with 32 additions and 3 deletions
|
@ -44,6 +44,23 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){
|
|||
|
||||
};
|
||||
|
||||
var uploadImage=function(fileToUpload, callback) {
|
||||
|
||||
|
||||
var result=$http.post('../server/index.php',
|
||||
$.param({"token" : Identity.getToken(), "task" : "image", 'action':'uploadImage', 'filename':fileToUpload, 'id':'6564'}));
|
||||
|
||||
// Wait and handle the response
|
||||
result.then(function (response){
|
||||
callback(parseUploadImageAnswer(response, false));
|
||||
},function(response){
|
||||
callback(parseUploadImageAnswer(response, true));
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var getData=function(response){
|
||||
return data;
|
||||
|
@ -52,7 +69,8 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){
|
|||
// Return services objects
|
||||
return {
|
||||
getImages:getImages,
|
||||
getData:getData
|
||||
getData:getData,
|
||||
uploadImage:uploadImage
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue