zoukankan      html  css  js  c++  java
  • 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 {
    }
  • 相关阅读:
    【css3】使用filter属性实现改变svg图标颜色
    Live CD
    Linux定时任务 crontab(-l -e)、at、batch
    linux图形界面 KDE、GNOME
    shell脚本3——调试
    shell脚本2——控制语句
    bash:双引号和单引号
    shell脚本1——变量 $、read、``
    SSH
    Linux关机、重启、退出
  • 原文地址:https://www.cnblogs.com/momjs/p/10924445.html
Copyright © 2011-2022 走看看