jfcere / ngx-malihu-scrollbar

Angular 2+ scrollbar customization using Malihu jQuery Custom Scrollbar plugin
https://jfcere.github.io/ngx-malihu-scrollbar
MIT License
58 stars 17 forks source link

_this.scrollableElement.mCustomScrollbar is not a function #22

Closed kathiraashi closed 5 years ago

kathiraashi commented 6 years ago

import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';

nilasissen commented 6 years ago

yup facing same issue

jfcere commented 6 years ago

I've been able to reproduce the problem on Plunker with UMD bundle.

I'll take a look at it this weekend, thanks for reporting the issue.

jfcere commented 6 years ago

Plunker is functional after adding jQuery and Malihu Custom Scrollbar javascript files.

Have you guys included those in your application as well?

As the error seems to point in the direction that it could not find mCustomScrollbar jQuery extension method.

nilasissen commented 6 years ago

thanks for seeing it ! yes i have followed your guide and jquery & malihu js is included in my project . Thanks for the plunker let me check it first

unikzforce commented 6 years ago

mine too, anyway the plunkr is broken

jfcere commented 6 years ago

@unikzforce sorry ... i updated the link in the comment.

unikzforce commented 6 years ago

thank you very much @jfcere .. but my problem with the "mCustomScrollbar is not a function" is not resolved yet. would you please guide me how to setup this lib with angular-cli and webpack .. i've just followed the instructions but still could not get it to work. could you please setup a working plunkr using webpack and angular-cli instead of SystemJs?

jfcere commented 6 years ago

Unfortunately plunker only works with SystemJS and does not work with Angular-CLI or webpack.

Angular-CLI Follow the installation section of the readme.md and/or take a look at the repository as it includes a demo-app already setup with Angular-CLI.

SystemJS For SystemJS you can refer to the plunker example that uses CDN for jQuery and malihu-custom-scrollbar-plugin.

Webpack only I do not have an example yet for people using webpack only (without Angular-CLI). I'll try to work on that in a near future.

jfcere commented 6 years ago

@nilasissen @unikzforce I'd like to help more about the issue but my attempts have all succeeded on my side with both SystemJS and Angular-CLI.

Can any of you provide a repository that has the issue?

nilasissen commented 6 years ago

@jfcere i am not sure wat was the issue but after using ur plunkr it worked for me currently i am using it and it works fine. @unikzforce did u import it as service ? u have to import import { MalihuScrollbarModule,MalihuScrollbarService } from 'ngx-malihu-scrollbar'; both.

jfcere commented 6 years ago

@unikzforce any update following previous comment?

einer20 commented 6 years ago

Restarting the ng serve worked for me.

jfcere commented 5 years ago

Closing as it seems to work for the majority of people, please reopen if there is anything.