Cannot load image from local resources folder (nativescript-ng2-carousel)




I have tried with nativescript-ng2-carousel plugin.
I tried with url means its working perfectly. If i tried to load image from local resource, that time its not working.

My folder structure as follows,

My code is,

this.images = [ 
{ title: 'Image 1', file: '~/res/logo.png' },
 { title: 'Image 2', url:''}

I think the issue with refer the resource from local folder structure.

Please suggest, How to refer the image from local resources folder.

Thanks in advance.


Perhaps res://logo.png



i. { title: ‘Image 0’, file: ‘res://logo.png’ }
ii. { title: ‘Image 0’, file: ‘res://logo’ }

Tried both of above, But not working.


I tried with creating the assets folder with image, inside app root structure.

Then referred that image as follows,

  {title: 'Image 2', file: '~/assets/carosel_screen.jpg'}

This time its working with local resources.

But issue with select and load the images from App-Resouces/android/drawable folder.


As i requested the author of this plugin, This issue was solved with recent released version 0.0.5 of this plugin.

So now we can able to load images from resources folder. We must set the resource name this way (without the image extenison .jpg, .png or whatever).
i.e { title: ‘Image 2’, file: ‘res://image-name’ }


For more details on this, please refer this issue and the documentation for further details.

Thanks for your involvement @sitefinitysteve.