Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dataSource] does not support Observables (using async pipe) #104

Closed
jurajplavcan opened this issue Oct 5, 2018 · 4 comments
Closed

[dataSource] does not support Observables (using async pipe) #104

jurajplavcan opened this issue Oct 5, 2018 · 4 comments
Labels

Comments

@jurajplavcan
Copy link

I tried to use other than static array for carousel items - I hooked up an observable of an array via an async pipe, but the behavior is strange.
Reproduction (I tried to cut the scenario to a very basic one):
https://stackblitz.com/edit/ngu-carousel-observable-data-source

Observable in the scenario above:

    this.carouselTileItems$ = interval(1000)
      .pipe(
        startWith(-1),
        take(10),
        map(i => [i, i + 1, i + 2])
      );

Only the last carousel tile is updated with new observed item. Moreover checking the page DOM, there are many <ngu-tile>s created as the observable keeps serving new values (but to a user the carousel always appears to contain only 3 tiles):
image

Am I doing anything wrong? Did I forget any config?

@sheikalthaf sheikalthaf added the bug label Oct 5, 2018
@sheikalthaf
Copy link
Collaborator

@jurajplavcan Hi,

Thanks for reporting. Fixed this issue. I forgot to remove the item whose currentIndex is null. Will Push the update.

@sheikalthaf
Copy link
Collaborator

@jurajplavcan this issue is fixed. Please check release.

Thanks

@jurajplavcan
Copy link
Author

jurajplavcan commented Oct 10, 2018

@kleino
Copy link

kleino commented Nov 21, 2018

@sheikalthaf There still seems to be an issue with observables when displaying more than one tile at the same time. Some tiles get duplicated after a couple of times. See https://stackblitz.com/edit/ngu-carousel-observable-data-source-vx6xfk for an example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants