Hana Wujira
Hana Wujira

Reputation: 880

ngx-perfect-scrollbar is not working

I want to include perfect-scrollbar in my project so I installed and included it in my project as demonstrated below.

But this error is displaying when I run the project:

app.module

import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar';
    import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
const PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
suppressScrollX: true
};
@NgModule({
imports: [
PerfectScrollbarModule.forRoot(PERFECT_SCROLLBAR_CONFIG)
]

but i keep getting this error

SyntaxError: Unexpected token < at eval () at SystemJSLoader.__exec (http://localhost:47112/node_modules/systemjs/dist/system.src.js:1555:18) at entry.execute

Upvotes: 0

Views: 1481

Answers (2)

Sunil
Sunil

Reputation: 411

Add this line to systemjs.config.js`and 'systemjs.debug.config.js'

'ngx-perfect-scrollbar': 'npm:ngx-perfect-scrollbar/bundles/ngx-perfect-scrollbar.umd.js'

Example:

(function(global){
System.config({
    paths: {
        'npm:' : 'node_modules/'
    },
    map: {
        app: 'app',
        ........
        ........

        'ngx-perfect-scrollbar': 'npm:ngx-perfect-scrollbar/bundles/ngx-perfect-scrollbar.umd.js'
    },
    packages: {
        ........
        ........

    }
});
})(this);

Upvotes: 1

user3589343
user3589343

Reputation: 11

I had to add this line:

'ngx-perfect-scrollbar': 'npm:ngx-perfect-scrollbar/bundles/ngx-perfect-scrollbar.umd.js'

to systemjs.config.js.

Upvotes: 1

Related Questions