You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to include the breadcrumb in a feature module. not in the root/app module.
if i import BreadcrumbsModule and use it as discribed <breadcrumb [allowBootstrap]="true"></breadcrumb> in my headerModule
i get the Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
But BrowserModule is only imported in my Root/App module. the feature module - headerModule- imports Common Module
app.module.ts
`import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {AppRoutingModule} from "./app-routing.module";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import 'bootstrap/dist/css/bootstrap.min.css';
header.module.ts
`import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {HeaderRoutingModule} from "./header-routing.module";
import {HeaderComponent} from "./header.component";
import {BreadcrumbsModule} from "ng2-breadcrumbs";
I try to include the breadcrumb in a feature module. not in the root/app module.
if i import BreadcrumbsModule and use it as discribed
<breadcrumb [allowBootstrap]="true"></breadcrumb>
in my headerModulei get the Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
But BrowserModule is only imported in my Root/App module. the feature module - headerModule- imports Common Module
app.module.ts
`import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {AppRoutingModule} from "./app-routing.module";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import 'bootstrap/dist/css/bootstrap.min.css';
@NgModule({
imports: [
AppRoutingModule,
BrowserModule,
NgbModule.forRoot(),
],
})
export class AppModule {
}
`
header.module.ts
`import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {HeaderRoutingModule} from "./header-routing.module";
import {HeaderComponent} from "./header.component";
import {BreadcrumbsModule} from "ng2-breadcrumbs";
@NgModule({
imports: [
CommonModule,
HeaderRoutingModule,
BreadcrumbsModule
],
declarations: [
HeaderComponent,
],
exports: [
HeaderComponent,
],
})
export class HeaderModule {
}
header.component.ts
import {Component} from '@angular/core';@component({
selector: 'pp-header',
template:
<div class="header-container"> <div class="breadCrumb"> <breadcrumb [allowBootstrap]="true"></breadcrumb> </div> </div>
,styleUrls: [String('../../styles.css'), String('./header.css')]
})
export class HeaderComponent {}
`
The text was updated successfully, but these errors were encountered: