lundi 12 octobre 2015

Emberjs not picking up Cordova Asset Filename changes for background-image

I’ve an issue with Ember and Cordova and filenames. I am using a template to load a background image for each product in my list of products.

I have for example two files in my assets/images folder, 'logo.jpg', and '8kg.jpg', and the following two lines in my templates.

<img src="images/logo.png" alt="" />

<div class="image" style="background-image:url('images/{{product.imageFilename}}')">

When it interpolates the Handlebars template, the markup looks like this:

<img src="images/logo788888484747499929292347.png">

<div style="background-image:url('images/8kg.jpg')"></div>

The logo loads fine but the div does not find the background image because the file name is no longer correct.

Cordova changes all the actual filenames during build. The filenames after build are 'logo788888484747499929292347.jpg' (or something like this) and aka '8kg234293872fsdfa9e87rawe98f.jpg'.

Is there a way to

1/ Stop Cordova from changing the asset names

Or

2/ Get the Handlebars template to look for the adjusted filename.

Aucun commentaire:

Enregistrer un commentaire