Android : cordova serving images with angular ng-src from a folder internal to an android device

on Thursday, October 9, 2014


in an ng-repeat directive, i need to serve images from a folder internal to the target device, allowing a certain easiness for updates.


I know only two methods to load images and both are obviusly not working:



<cart-item ng-repeat="item in cart.items">
<img ng-src="http://myserver/project/images/{{item.name}}.jpeg" alt="">
<h4>{{item.name}}</h4>
</cart-item> // but with this of course everytime i'm downloading images from server


or



<cart-item ng-repeat="item in cart.items">
<img ng-src="images/{{item.name}}.jpeg" alt="">
<h4>{{item.name}}</h4>
</cart-item> // and with this all images are compiled inside apk. (must recompile everytime i want to change a single image??)


so.. how to obtain something like :



<img ng-src="sdcardonandroid/mydreamfolder/{{item.name}}.jpeg" alt="">


Thanks


0 comments:

Post a Comment