return self object promise then function object return self currentUse

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
return self.object.$promise.then(function(object) {
return self.currentUser.$promise.then(function() {
return self.fileUploader.getUploadedFiles();
}).then(function(uploadedFiles) {
if (uploadedFiles !== undefined) {
self.feedMessage.uploaded_files = uploadedFiles.map(function (uploadedFile) {
return uploadedFile.data['uuid'];
});
}
return resource.postFeed(self.feedMessage).$promise.then(function (postedMessage) {
self.feedMessage = initFeedMessage(object.id);
self.feed.splice(0, 0, postedMessage);
self.fileUploader.clearUploads();
self.object.following = true;
addFollower(self.currentUser);
});
});
});