Closed hadirsa closed 6 years ago
The module you've pasted here is SharedLibsModule
, is this the module that gets bootstrapped by your main.ts
? I tried moving the SidebarModule.forRoot()
import to another module imported by the main bootstrapped module and the error that I get now is consistent with what you posted.
As far as I can tell, any module for which you call forRoot()
must be imported in app.module
and nowhere else.
thanks for response.I'm going to check and i will share the result. 👍
You probably have to also have to import SidebarModule
in your main.module as well as having your SidebarModule.forRoot()
in your app.module.
Is ng-sidebar supports Angular 9/10 as I am getting error 'ng-sidebar-container' is not a known element?
> 'ng-sidebar-container' is not a known element:
> 1. If 'ng-sidebar-container' is an Angular component, then verify that it is part of this module.
> 2. If 'ng-sidebar-container' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component
> to suppress this message.
I am not able to figure out why Angular is throwing such errors when I have added all desired entries in the App Module.
import { SidebarModule,SidebarContainer } from 'ng-sidebar';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
WorkerFormComponent,
TopbarNavComponent,
TogglerComponent,
SidebarNavComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
SidebarModule.forRoot(),
...]
NG Version Details.
Angular CLI: 10.0.2
Node: 12.18.2
OS: win32 x64
Angular: 10.0.3
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1000.2
@angular-devkit/build-angular 0.1000.2
@angular-devkit/build-optimizer 0.1000.2
@angular-devkit/build-webpack 0.1000.2
@angular-devkit/core 10.0.2
@angular-devkit/schematics 10.0.2
@angular/cli 10.0.2
@angular/fire 6.0.2
@ngtools/webpack 10.0.2
@schematics/angular 10.0.2
@schematics/update 0.1000.2
rxjs 6.5.5
typescript 3.9.6
webpack 4.43.0
hi, i have imported
SidebarModule.forRoot(),
in shared module and y shared module is imported in app.module :and i use sample code in my main layout like below:
main.layout.html:
main.component.ts:
I run the app and get this error:
I cant understand why i get this error.