Angular Module 共享模块使用 父模块使用多个子模块
Posted fightingyy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Angular Module 共享模块使用 父模块使用多个子模块相关的知识,希望对你有一定的参考价值。
Component.module.ts
import {BrowserModule} from ‘@angular/platform-browser‘;
import {LocationStrategy, HashLocationStrategy} from ‘@angular/common‘;
import {NgModule} from ‘@angular/core‘;
import {FormsModule} from ‘@angular/forms‘;
import {HttpClientModule} from ‘@angular/common/http‘;
import { HeaderComponent } from ‘./header/header.component‘;
import { FootComponent } from ‘./foot/foot.component‘;
import { BodyComponent } from ‘./body/body.component‘;
@NgModule({
declarations: [
HeaderComponent,
BodyComponent,
FootComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
],
exports:[
HeaderComponent,
BodyComponent,
FootComponent,
]
,
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],
bootstrap: [
]
})
export class ComponentModule {
}
app.module.ts
@NgModule({
declarations: [
AppComponent,
AnalysisComponent,
LoginComponent,
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
routing,
//ChartsModule,
DashboardModule,
ComponentModule
],
exports:[
],
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],
bootstrap: [AppComponent]
})
export class AppModule {
}
以上是关于Angular Module 共享模块使用 父模块使用多个子模块的主要内容,如果未能解决你的问题,请参考以下文章