Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Inserting HTML for Slides from Typescript File

$
0
0

@jqx23 wrote:

I have code in my ts file that puts most of the html code for slides I have into a string(I need to do this because I have to traverse through an object recursively and I’m layering images on svg’s and need to transform them). So this function would generate a large string that looks like

<ion-slides>
  <ion-slide>
    <svg ...>layers of images</svg>
  </ion-slide>
  <ion-slide>
    <svg ...>layers of images</svg>
  </ion-slide>
  <ion-slide>
    <svg ...>layers of images</svg>
  </ion-slide>
</ion-slides>

When I paste this code into the html file, the slides work perfectly, but when I put the string into a div and setting its innerHTML like so

  ionViewDidLoad(){
    document.getElementById('div').innerHTML = this.htmlstring;
  }

the slides appear as a list of images instead of as slides and when I put them inside the ion-content groups, setting the innerHTML to the string just results in an image list as well except I can’t even scroll through it, instead of slides.

Is there any way to fix this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>