vendredi 18 décembre 2015

Call service method from a property

I am getting an error in the console saying the service is not defined when attempting to call a service method inside a property on my controller.

itemImage: function(){
    return this.get('s3').getItemImage(this.get('user.active_auction'),this.get('model.item_image'));
}.property(),

The error states

Uncaught ReferenceError: s3 is not defined

The method should go out to s3, get an item.

getItemImage(auction_id, image) {
    var self = this;
    s3.getObject({Bucket: self.get('bucketName'),Key: auction_id+'/'+image},function(err,data){
        if (err) {
            console.log(err, err.stack);
        } else {
            console.log(data);
            return data;
        }
   })
}

What must I do to get this to work?




Aucun commentaire:

Enregistrer un commentaire