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

the name 'MalihuScrollbarService' was not found #31

Closed marcoshier closed 5 years ago

marcoshier commented 6 years ago

Hi, I've tried to import the script into my angular project and I want to use it in a component with the Service method. But after following the instructions the compiler gives me this error:

error TS2304: Cannot find name 'MalihuScrollbarService'

refering to the MalihuScrollbarService in the constructor (private mScrollbarService: MalihuScrollbarService)

Still quite new to angular by the way.

jfcere commented 6 years ago

Hi @shierone, did you add MalihuScrollbarModule.forRoot() to the list of imports in your AppModule ?

app.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
+ import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';

import { AppComponent } from './app.component';

@NgModule({
  imports: [
    CommonModule,
+   MalihuScrollbarModule.forRoot(),
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
export class AppModule { }
jfcere commented 5 years ago

Close for inactivity, please reopen if there is anything.