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

I have an error in this, TypeError: _this.$instance.slick is not a function #38

Open
karthickmsobs opened this issue Aug 1, 2018 · 12 comments

Comments

@karthickmsobs
Copy link

Pls guide me.

ThumbSliderComponent.html:70 ERROR TypeError: _this.$instance.slick is not a function
at eval (ngx-slick.umd.js:78)
at ZoneDelegate.invoke (zone.js:388)
at Zone.run (zone.js:138)
at NgZone.runOutsideAngular (core.js:4708)
at SlickComponent.initSlick (ngx-slick.umd.js:70)
at SlickComponent.addSlide (ngx-slick.umd.js:113)
at SlickItemDirective.ngAfterViewInit (ngx-slick.umd.js:256)
at callProviderLifecycles (core.js:12748)
at callElementProvidersLifecycles (core.js:12715)
at callLifecycleHooksChildrenFirst (core.js:12698)

@tsams
Copy link

tsams commented Aug 2, 2018

Same issue!!!

@MaciejWWojcik
Copy link

same

1 similar comment
@jzfre
Copy link

jzfre commented Aug 27, 2018

same

@alcoceba
Copy link

Does anyone resolved it?

@Brone88
Copy link

Brone88 commented Oct 1, 2018

same

@ParasShahh
Copy link

same issue any
Please suggest any other carousel for angular 7
Thanks

@arunnayak
Copy link

Can anyone suggest how to fix this?

@shansubra
Copy link

shansubra commented Dec 21, 2018

I had the same issue and this is how I fixed it.

Open the ngx-slick.umd.js file (which can be found in this location - node_modules\ngx-slick)
and find SlickComponent.prototype.initSlick function then inside this function this.zone.runOutsideAngular(function () { add this line

jQuery.noConflict();

and then replace these lines:

jQuery(_this.el.nativeElement)[0].innerHTML = '';
_this.$instance = jQuery(_this.el.nativeElement);

with these lines (i.e. change jQuery to $):

$(_this.el.nativeElement)[0].innerHTML = '';
_this.$instance = $(_this.el.nativeElement);

Hope this helps.

@phutaneVinayak
Copy link

@shansubra is we need to compile ngx-slick.umd.js again for minification or something else ?

@phutaneVinayak
Copy link

@shansubra thanks its solve the issue.

@paulpenafiel
Copy link

I had the same issue and this is how I fixed it.

Open the ngx-slick.umd.js file (which can be found in this location - node_modules\ngx-slick)
and find SlickComponent.prototype.initSlick function then inside this function this.zone.runOutsideAngular(function () { add this line

jQuery.noConflict();

and then replace these lines:

jQuery(_this.el.nativeElement)[0].innerHTML = '';
_this.$instance = jQuery(_this.el.nativeElement);

with these lines (i.e. change jQuery to $):

$(_this.el.nativeElement)[0].innerHTML = ''; _this.$instance = $(_this.el.nativeElement);

Hope this helps.

Thanks your solution solved my problem

@shansubra
Copy link

@paulpenafiel Glad that it worked for you.

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