1

I use Ionic 2 and I try to use a picture from a json file for the background of an ion-slide.

But I have this error :

WARNING: sanitizing unsafe style value background-image: url()

There is my code :

<ion-slides [options]="mySlideOptions" style="height: 50%">
    <ion-slide *ngFor="let actualite of this.dL.actualites" style="background-image: url({{actualite.image}})">
        <h2>{{actualite.titre}}</h2>
      <label>{{actualite.contenu}}</label><br><br>
      <label>{{actualite.date}}</label>
    </ion-slide>
  </ion-slides>

Someone have any idea please ? :)

  • You need to sanitize (tell Angular2 that you consider this content safe) like explained in http://stackoverflow.com/questions/37076867/in-rc-1-some-styles-cant-be-added-using-binding-syntax/37076868#37076868 – Günter Zöchbauer Dec 31 '16 at 14:09

0 Answers0