Page 1 of 1

Binding Image src - ng-src - Bootstrap/AngularJS

Posted: Sun Mar 29, 2015 9:22 pm
by Dupdroid

I'm trying to bind the url of an image stored in my db but I'm not sure how to do this.

I'm using a function to build the url:

function fileUrl (value) {
return 'https://api.appery.io/rest/1/db/files/' + MyAppName_settings.database_id + '/' + value;
}

I have tried to add : fileUrl({{artist.photo}}) to ng-src but the resulting url when running the app is wrong:

code<img ng-src="fileUrl(00ea000e-0f0f-000a-acd4-046a3a0116e8&#46;Filename&#46;jpg)" width="" height="" src="fileUrl(00ea000e-0f0f-000a-acd4-046a3a0116e8&#46;Filename&#46;jpg)" class="img-default " alt="Image error">/code

It is obvious that the function is not executed when the db mapping takes place.

Please help,


Binding Image src - ng-src - Bootstrap/AngularJS

Posted: Mon Mar 30, 2015 5:56 am
by Dupdroid

Fixed {{fileUrl(artist.photo)}}


Binding Image src - ng-src - Bootstrap/AngularJS

Posted: Mon Mar 30, 2015 6:21 am
by Alena Prykhodko

Thank you for update.