fcarrascosa / fcarrascosa-slider

A simple Slider made with lit-element
ISC License
1 stars 2 forks source link

Doesn't work with async rendering #92

Open Narretz opened 3 years ago

Narretz commented 3 years ago

This is more of a head's up than a bug report.

I've tried to use the slider with Angular, and render the slides with *ngFor:

  <fcarrascosa-slider>
    <fcarrascosa-slider-slide
      *ngFor="let image of imageSet"
      [attr.image]="image.path"
    ></fcarrascosa-slider-slide>
  </fcarrascosa-slider>

There are 2 problems with this:

  1. The slides are rendered after the slider, so when the slider constructor is called, it doesn't find any slides
  2. The image attr is set after the element is created, so the slide constructor throws an error because image is unset