ng2-nouislider: NouisliderModule is not an NgModule

I just switched over to angular cli for my project and when I try and serve the project i get the below error, thus crashing the attempt to compile the application so it can be served

NouisliderModule is not an NgModule

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 32 (1 by maintainers)

Most upvoted comments

I fixed this by change the import path of the module: import {NouisliderModule} from 'ng2-nouislider' => import {NouisliderModule} from 'ng2-nouislider/src/nouislider'

@karan83 I did the same think you said "styles": [ "styles.css", "../node_modules/nouislider/distribute/nouislider.min.css" ], in my angular-cli.json.

I added the following html <nouislider [connect]="true" [min]="0" [max]="15" [(ngModel)]="someRange"></nouislider>

when I run I get

EXCEPTION: Error in ./AppComponent class AppComponent - inline template:4:50 caused by: noUiSlider (9.2.0): ‘start’ is required.

error_handler.js:56Error: noUiSlider (9.2.0): ‘start’ is required. at http://localhost:4200/vendor.bundle.js:82478:12 [angular] at Array.forEach (native) [angular] at testOptions (http://localhost:4200/vendor.bundle.js:82472:22) [angular] at Object.initialize [as create] (http://localhost:4200/vendor.bundle.js:83751:17) [angular] at NouisliderComponent.ngOnInit (http://localhost:4200/vendor.bundle.js:81432:34) [angular] at Wrapper_NouisliderComponent.ngDoCheck (/AppModule/NouisliderComponent/wrapper.ngfactory.js:180:53) [angular] at CompiledTemplate.proxyViewClass.View_AppComponent0.detectChangesInternal (/AppModule/AppComponent/component.ngfactory.js:73:33) [angular] at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:4200/vendor.bundle.js:74489:14) [angular] at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:4200/vendor.bundle.js:74684:44) [angular] at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:4200/vendor.bundle.js:74474:18) [angular] at CompiledTemplate.proxyViewClass.View_AppComponent_Host0.detectChangesInternal (/AppModule/AppComponent/host.ngfactory.js:29:19) [angular] at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:4200/vendor.bundle.js:74489:14) [angular] at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:4200/vendor.bundle.js:74684:44) [angular] at ViewRef_.detectChanges (http://localhost:4200/vendor.bundle.js:55251:20) [angular]

@visar1897 Thank You 😃

Put NouisliderComponent in declarations not imports.