-
Notifications
You must be signed in to change notification settings - Fork 46
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
Cannot read property 'slick' of undefined #6
Comments
@snaik2064 @devmark |
Just a quick and probably not appropriate solution but working. in ngx-slick folder, open index.js and find @devmark Please let us know how can we fix this issue. Thanks. |
@devmark @Taewa I am able to resolve this issue. The actual problem is inside ngx-slick.umd.js In which there are two code blocks:
so the real problem is if we are using "slick" inside OneComponent and then we are navigating to TwoComponent, then due to routing OneComponent get destroys along with our "slick" configuration variable. By commenting those both blocks you can achieve successful routing.(Not Recommended for live project) |
+1 - waiting for fix to be implemented.... |
2 similar comments
+1 - waiting for fix to be implemented.... |
+1 - waiting for fix to be implemented.... |
Just adding my observation - I'm using webpack with my angular2 app and the workaround steps @snaik2064 mentioned in his answer needed to be commented out not in ngx-slick.umd.js but in index.js in the same directory. Maybe lame but I was struggling with this for couple of hours couldn't understand why the "commented out" parts are still used... |
@gabosvk I have implemented Angular 4 project with systemJS, so there might be a difference between implementation of webpack and systemJS. So ngx-slick.umd.js solution works for me. I will also try your solution whether it works for me or not. But whether it's ngx-slick.umd.js or index.js , this correction should be done inside this repo so everyone's bug will get resolved. |
Since this only occurs when there are no slides, you can use the ngIf structural directive to only include the element or component containing the carousel if there is at least one slide.
|
depiction, I leave a view that has a ngx-slick for a new view that hasn't slide. |
Closed. open new issue if any question. |
@devmark Why closed? Is that fixed??? |
@devmark please reopen i still getting this error or provide some documentation to fix let get out of this issue
|
Same issue from here. Please reopen!
|
Someone has the solution for this warning??? I'm trying to use the ViewChild to control next and prev slides and I get this warning:
I have defined:
|
I am currently using ngx-slick@0.1.1 & angular version 4.2. After any router navigation i am getting this error
& getting this console
Because of this error our projects navigation fails although slick is working fine. So is there any configuration to solve this error?
The text was updated successfully, but these errors were encountered: