Reputation: 224
I have been trying to make the ngx-perfect-scrollbar
work. I have installed the library using
npm install ngx-perfect-scrollbar --save
after that I have added the dependency into my app.module.ts
. But when i run the app it gives error
Object(...) is not a function
I don't know what I am doing wrong here. All the steps have been followed as per in github repo.
Error is generated from line number 126
This is my html file
<div class="ps" style="position: relative; max-width: 600px; max-height: 400px;" [perfectScrollbar]="config">
<router-outlet></router-outlet>
</div>
Upvotes: 0
Views: 7833
Reputation: 1
I had the same issue when running Angular 5. I had installed ngx-perfect-scrollbar 6.x
, downgrading with the following commands resolved the issue for me:
npm remove ngx-perfect-scrollbar
npm install --save ngx-perfect-scrollbar@^5.0.0
Upvotes: 0
Reputation: 361
Add these line to your component header:
import { fromEvent } from 'rxjs/observable/fromEvent';
import { merge } from 'rxjs/observable/merge';
require('rxjs').fromEvent = fromEvent
require('rxjs').merge = merge
Upvotes: 1