Dynamically adding a shape image inside an ion-slide

I am using google static map on the form inside ion-slide, the image appears after the form was created and appeared, so the form is corrupted, I need to call update()

, but I don't know how and when?

 <img src="https://maps.googleapis.com/maps/api/staticmap?markers=color:red|{{Latitude}},{{Longitude}}&zoom=12&size=300x300&maptype=roadmap"/>

      

+3


source to share


1 answer


Since this is just an image, you can use an event load

:

<img [src]="..." (load)="imageLoaded()">

      



Then, in the component's code, update the slides to display its content correctly:

public imageLoaded(): void {
  // Here you can update the slides
}

      

+1


source







All Articles