Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

Binding Image src - ng-src - Bootstrap/AngularJS

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,

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

Binding Image src - ng-src - Bootstrap/AngularJS

Fixed {{fileUrl(artist.photo)}}

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Binding Image src - ng-src - Bootstrap/AngularJS

Thank you for update.

Return to “Issues”