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

owl carousel creates components 3 times #273

Open
brot1234 opened this issue Mar 28, 2024 · 0 comments
Open

owl carousel creates components 3 times #273

brot1234 opened this issue Mar 28, 2024 · 0 comments

Comments

@brot1234
Copy link

Hi,
I have this little project here

My template

<owl-carousel-o [options]="carouselOptions">
  <inf-new-arrivals *carouselSlide></inf-new-arrivals>
  <inf-team-charta *carouselSlide></inf-team-charta>
</owl-carousel-o>

The corresponding .ts

export class AppComponent {
  carouselOptions: OwlOptions = {
    loop: true,
    autoplay: true,
    autoplaySpeed: 2000,
    autoplayTimeout: 2500,
    dots: true,
    responsive: {
      0: {
        items: 1
      }
    },
  }
}

And one component

export class TeamChartComponent {
  employees$: Observable<string[]>;

  constructor(private calendar: CalendarService) {
    console.log("WOW")
    this.employees$ = this.calendar.getEmployeeReservations('ID',NUMBER);
  }
}

Now what happens here is that the constructor is called 3 times, so I see 3 "WOW"s in my console.
I believe this isn't supposed to be like that.

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

No branches or pull requests

1 participant