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

Can't bind to 'scrollbarOptions' since it isn't a known property of 'div'. #32

Closed muralimnmcse closed 6 years ago

muralimnmcse commented 6 years ago

I get this error message in Angular 5 - Can't bind to 'scrollbarOptions' since it isn't a known property of 'div'.

Angular CLI: 1.6.8 Node: 8.9.1 OS: win32 x64 Angular: 5.0.1 ... common, compiler, compiler-cli, core, forms, http ... language-service, platform-browser, platform-browser-dynamic ... router

@angular/animations: 5.2.1 @angular/cli: 1.6.8 @angular-devkit/build-optimizer: 0.0.42 @angular-devkit/core: 0.0.29 @angular-devkit/schematics: 0.0.52 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.9.8 @schematics/angular: 0.1.17 typescript: 2.4.2 webpack: 3.10.0

jfcere commented 6 years ago

You added 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 { }

And used scrollbarOptions with malihu-scrollbar directive like this?

example.component.ts

public scrollbarOptions = { axis: 'yx', theme: 'minimal-dark' };

example.component.html

<div malihu-scrollbar [scrollbarOptions]="scrollbarOptions">
   Lorem ipsum dolor sit amet, consectetur adipisicing elit...
</div>
muralimnmcse commented 6 years ago

Yes did exactly the same, but now suddenly it works thanks.

luchillo17 commented 6 years ago

Mine works but VSCode screams at me: image