ngx-slick icon indicating copy to clipboard operation
ngx-slick copied to clipboard

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

Open karthickmsobs opened this issue 6 years ago • 12 comments

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)

karthickmsobs avatar Aug 01 '18 13:08 karthickmsobs

Same issue!!!

tsams avatar Aug 02 '18 20:08 tsams

same

MaciejWWojcik avatar Aug 08 '18 15:08 MaciejWWojcik

same

jzfre avatar Aug 27 '18 13:08 jzfre

Does anyone resolved it?

alcoceba avatar Aug 28 '18 17:08 alcoceba

same

Brone88 avatar Oct 01 '18 16:10 Brone88

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

ParasShahh avatar Nov 01 '18 13:11 ParasShahh

Can anyone suggest how to fix this?

arunnayak avatar Nov 01 '18 22:11 arunnayak

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.

shansubra avatar Dec 21 '18 03:12 shansubra

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

phutaneVinayak avatar Jan 02 '19 09:01 phutaneVinayak

@shansubra thanks its solve the issue.

phutaneVinayak avatar Jan 02 '19 09:01 phutaneVinayak

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

paulpenafiel avatar Feb 24 '19 07:02 paulpenafiel

@paulpenafiel Glad that it worked for you.

shansubra avatar Feb 24 '19 17:02 shansubra