rd-dev-ukraine / angular-io-slimscroll

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

Error: Unexpected value 'SlimScroll' declared by the module 'SharedModule'. Please add a @Pipe/@Directive/@Component annotation. #26

Open dogabaris opened 6 years ago

dogabaris commented 6 years ago

package.json

{
  "version": "1.0.0",
  "name": "argelogduvar",
  "private": true,
  "scripts": {
    "start": "webpack-dev-server --open",
    "build": "webpack --env=prod --progress --profile --colors",
    "test": "ng test",
    "hmr": "ng serve --hmr -e=hmr"
  },
  "dependencies": {
    "@angular/animations": "4.3.5",
    "@angular/cdk": "2.0.0-beta.10",
    "@angular/common": "4.3.5",
    "@angular/compiler": "4.3.5",
    "@angular/compiler-cli": "4.3.5",
    "@angular/core": "4.3.5",
    "@angular/flex-layout": "2.0.0-beta.9",
    "@angular/forms": "4.3.5",
    "@angular/http": "4.3.5",
    "@angular/material": "2.0.0-beta.10",
    "@angular/platform-browser": "4.3.5",
    "@angular/platform-browser-dynamic": "4.3.5",
    "@angular/platform-server": "4.3.5",
    "@angular/router": "4.3.5",
    "@angular/upgrade": "4.3.5",
    "@types/angular": "1.6.32",
    "angular-in-memory-web-api": "0.3.2",
    "angular-io-slimscroll": "2.3.1",
    "angular-mentions": "^0.8.0",
    "angular-text-input-highlight": "^1.3.0",
    "bootstrap": "3.3.7",
    "core-js": "2.5.0",
    "hammerjs": "2.0.8",
    "ie-shim": "0.1.0",
    "jquery": "3.2.1",
    "ng2-signalr": "2.1.0",
    "ngx-infinite-scroll": "0.8.2",
    "pump": "^2.0.0",
    "rxjs": "5.4.3",
    "signalr": "2.2.2",
    "systemjs": "0.20.18",
    "tslib": "1.7.1",
    "typings": "2.1.1",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "1.6.7",
    "@angularclass/hmr": "^2.1.3",
    "@types/jasmine": "^2.8.5",
    "angular-router-loader": "0.8.2",
    "angular2-template-loader": "0.6.2",
    "awesome-typescript-loader": "3.4.1",
    "clean-webpack-plugin": "^0.1.17",
    "gulp": "3.9.1",
    "gulp-clean": "0.3.2",
    "gulp-concat": "2.6.1",
    "gulp-tsc": "~1.3.2",
    "gulp-typescript": "3.2.2",
    "gulp-uglify": "^3.0.0",
    "html-loader": "0.5.5",
    "jasmine": "^2.9.0",
    "karma": "^2.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage-istanbul-reporter": "^1.4.1",
    "karma-jasmine": "^1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "path": "0.12.7",
    "phantomjs": "^2.1.7",
    "phantomjs-prebuilt": "^2.1.16",
    "run-sequence": "^2.2.1",
    "source-map-loader": "0.2.3",
    "ts-loader": "3.3.1",
    "tsconfig-paths-webpack-plugin": "2.0.0",
    "tslint": "5.9.1",
    "tslint-loader": "3.5.3",
    "typescript": "2.6.2",
    "webpack": "^3.10.0",
    "webpack-dev-server": "^2.11.1"
  }
}

shared.module.ts

import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SlimScroll } from "angular-io-slimscroll";

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

Module that i want to use scroll boot.ts

@NgModule({
    imports: [
        ...
        SharedModule
    ],
    declarations: [
        ....
    ],
    providers: [
        ...
    ],
    bootstrap: [AppComponent],
    exports: [
        ...
    ]
})
export class AppModule { }

this is how i added slimscroll app.html

<div slimScroll
                 width="auto"
                 height="600px"
                 size="7px"> ..... </div>

Error: Unexpected value 'SlimScroll' declared by the module 'SharedModule'. Please add a @Pipe/@Directive/@Component annotation.

In Angular 4.3.5 i cant import this directive into declaration its not working.

kirobo commented 6 years ago

Same error seems like this developer has abandoned the project.

ishan123456789 commented 6 years ago

24 The solution referred there might help you