mujtaba01 / ngx-owl-carousel

An angular2 (4) wrapper for jquery owl-carousel library with dynamic carousel item change detection
MIT License
70 stars 25 forks source link

Cannot read property 'trigger' of undefined when calling this.owlElement.next() #10

Closed enesr closed 7 years ago

enesr commented 7 years ago

Hi,

I'm facing this error when calling this.owlElement.next([200]) to refresh the owl component:

ERROR TypeError: Cannot read property 'trigger' of undefined
    at OwlCarousel.webpackJsonp.376.OwlCarousel.trigger (owl-carousel.component.js:64)
    at OwlCarousel.webpackJsonp.376.OwlCarousel.next (owl-carousel.component.js:55)
    at LoginComponent.webpackJsonp.388.LoginComponent.updateOwl (login.component.ts:88)
    at login.component.ts:41
    at ZoneDelegate.invokeTask (zone.js:398)
    at Object.onInvokeTask (core.es5.js:4116)
    at ZoneDelegate.invokeTask (zone.js:397)
    at Zone.runTask (zone.js:165)
    at ZoneTask.invoke (zone.js:460)
    at timer (zone.js:1655)

The component actually gets refreshed only if the clicks anywhere on the page. Any ideas?

sukrit786 commented 4 years ago

how did u resolve the issue