码迷,mamicode.com
首页 > 其他好文 > 详细

Angular Module 共享模块使用 父模块使用多个子模块

时间:2019-05-26 00:29:05      阅读:560      评论:0      收藏:0      [点我收藏+]

标签:analysis   ati   browser   rdm   login   from   header   common   oar   

      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 共享模块使用 父模块使用多个子模块

标签:analysis   ati   browser   rdm   login   from   header   common   oar   

原文地址:https://www.cnblogs.com/momjs/p/10924445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!