rd-dev-ukraine / angular-io-slimscroll

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

No provider for RendererFactory2 #24

Open andrzejpindor opened 6 years ago

andrzejpindor commented 6 years ago

Hi, I installed your slimscroll but got errors when trying to run it: AppComponent.html:1 ERROR Error: StaticInjectorError(AppModule)[SlimScroll -> RendererFactory2]: StaticInjectorError(Platform: core)[SlimScroll -> RendererFactory2]: NullInjectorError: No provider for RendererFactory2! at _NullInjector.get (core.js:994) at resolveToken (core.js:1292) at tryResolveToken (core.js:1234) at StaticInjector.get (core.js:1102) at resolveToken (core.js:1292) at tryResolveToken (core.js:1234) at StaticInjector.get (core.js:1102) at resolveNgModuleDep (core.js:10847) at NgModuleRef_.get (core.js:12080) at resolveDep (core.js:12570)

My Angular version is 5.2.0. Can you help me, please?

eugenesaenko commented 6 years ago

Which version do you use?

andrzejpindor commented 6 years ago

Version 2.3.3 downloaded from npm.

mike-yashin commented 6 years ago

Confirm, same issue for v2.3.3 + Angular 5.2.3

alibahri commented 6 years ago

same issue for v2.3.3,2.3.2,2.3,1 on angular 5.2.4

pashaie commented 6 years ago

same here, angular 5.2.5 angular-io-slimscroll 2.3.3

c17r commented 6 years ago

I have the same problem as others but what worked for me was taking the slimscroll.directive.ts file from the repo and putting directly into my project. So it seems like something with the npm package?

santoshshelke commented 6 years ago

I am also facing same issue, tried to add slimscroll.directive.ts file from the repo but still issue is not resolved.

ishan123456789 commented 6 years ago

The solution as referred by @c17r the solution is to copy slimscroll.directive.ts from https://github.com/rd-dev-ukraine/angular-io-slimscroll/blob/master/slimscroll.directive.ts link and add it to the module where you are declaring and exporting the directive. so now you will import it like this

import {SlimScroll} from './slimscroll.directive';

Manjunath-Siddappa commented 6 years ago

it is working now as suggested by @ishan123456789

additional steps.

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {SlimScroll} from './slimscroll.directive';

@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [SlimScroll],
  exports: [SlimScroll]
})
export class ScrollModule { }