rd-dev-ukraine / angular-io-slimscroll

Customizable slimScroll directive for Angular 2.
MIT License
18 stars 19 forks source link

ERROR Error: Uncaught (in promise): Error: StaticInjectorError[Renderer2] #19

Closed pr0menade closed 6 years ago

pr0menade commented 6 years ago

Current behavior

ERROR Error: Uncaught (in promise): Error: StaticInjectorError[Renderer2]: StaticInjectorError[Renderer2]: NullInjectorError: No provider for Renderer2! Error: StaticInjectorError[Renderer2]: StaticInjectorError[Renderer2]: NullInjectorError: No provider for Renderer2!

Expected behavior

No error and navigate to new page.

Environment

Angular version 5.1.0

  "dependencies": {
    "@agm/core": "^1.0.0-beta.2",
    "@angular/animations": "~5.1.0",
    "@angular/common": "~5.1.0",
    "@angular/compiler": "~5.1.0",
    "@angular/compiler-cli": "~5.1.0",
    '@angular/core': "~5.1.0",
    "@angular/forms": "~5.1.0",
    "@angular/http": "~5.1.0",
    "@angular/platform-browser": "~5.1.0",
    "@angular/platform-browser-dynamic": "~5.1.0",
    "@angular/platform-server": "~5.1.0",
    "@angular/router": "~5.1.0",
    "@angular/upgrade": "~5.1.0",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.7",
    "@nicky-lenaers/ngx-scroll-to": "^0.5.0",
    "@swimlane/ngx-datatable": "^11.1.5",
    "angular-froala-wysiwyg": "^2.7.3",
    "angular-in-memory-web-api": "~0.5.2",
    "angular-io-slimscroll": "^2.0.0",
    "angular2-chartjs": "^0.4.1",
    "angular2-notifications": "^0.9.6",
    "bootstrap": "^4.0.0-beta.2",
    "c3": "^0.4.18",
    "child_process": "^1.0.2",
    "core-js": "^2.5.3",
    "css-animator": "^2.2.1",
    "d3": "^4.12.0",
    "echarts": "^3.8.5",
    "famfamfam-flags": "^1.0.0",
    "font-awesome": "^4.7.0",
    "gulp": "^3.9.1",
    "gulp-exec": "^2.1.3",
    "gulp-karma": "0.0.5",
    "gulp-load-plugins": "^1.5.0",
    "gulp-run": "^1.7.1",
    "install": "^0.10.2",
    "jquery": "^3.2.1",
    "jquery-sparkline": "^2.4.0",
    "ng-click-outside": "^3.1.1",
    "ng-select": "^1.0.0-rc.3",
    "ng2-file-upload": "^1.3.0",
    "ng2-google-charts": "^3.3.0",
    "ng2-nvd3": "^2.0.0",
    "ngx-bootstrap": "^2.0.0-beta.11",
    "ngx-color-picker": "^5.2.0",
    "ngx-echarts": "^2.0.1",
    "ngx-facebook": "^2.4.0",
    "npm": "^5.6.0",
    "popper.js": "^1.12.9",
    "run-sequence": "^2.2.0",
    "rxjs": "^5.5.5",
    "squeezebox": "^1.2.0",
    "sweetalert2": "^7.0.10",
    "ti-icons": "^0.1.2",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.18"
  }
eugenesaenko commented 6 years ago

Please provide more info about your usage of component.

pr0menade commented 6 years ago

I use this theme - http://html.codedthemes.com with Angular 5.1.0 and it's not working

Module used in the html template in the component that was imported in App Module

templateUrl: './admin.component.html' :

<div slimScroll class="main-friend-list scroll-window" width="100%" size="7px" color="rgb(27, 139, 249)" opacity="0.4">
              <div (click)="toggleChatInner()" class="media userlist-box" data-id="1" placement="left" ngbTooltip="Josephin Doe">
@NgModule({
    imports: [
        CommonModule,
        ScrollModule,
        NgbModule
    ],
    declarations: [
        AccordionAnchorDirective,
        AccordionLinkDirective,
        AccordionDirective,
        ModalAnimationComponent,
        ModalBasicComponent,
        NgbdModalContentComponent,
        SpinnerComponent
    ],
    exports: [
        AccordionAnchorDirective,
        AccordionLinkDirective,
        AccordionDirective,
        ModalAnimationComponent,
        ModalBasicComponent,
        NgbdModalContentComponent,
        SpinnerComponent,
        ScrollModule
    ],
    entryComponents: [
        NgbdModalContentComponent
    ],
    providers: [ MenuItems ]
})
export class SharedModule { }
eugenesaenko commented 6 years ago

Try to write Slimscroll directive in declaration of your SharedModule

eugenesaenko commented 6 years ago

For now it is not reproducing.

pr0menade commented 6 years ago

works fine just if I added it manually