zoukankan      html  css  js  c++  java
  • @NgModule

    @NgModule 的使用方式
    看一个最简单的 @NgModule 的定义:

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';

    import { AppComponent } from './app.component';
    import { TestViewChildComponent } from './test-view-child/test-view-child.component';
    import { ChildOneComponent } from './test-view-child/child-one/child-one.component';

    @NgModule({
    declarations: [
    AppComponent,
    TestViewChildComponent,
    ChildOneComponent
    ],
    imports: [
    BrowserModule
    ],
    providers: [],
    bootstrap: [AppComponent]
    })
    export class AppModule { }


    declarations:用来放组件、指令、管道的声明。
    imports:用来导入外部模块。
    providers:需要使用的 Service 都放在这里。
    bootstrap:定义启动组件。你可能注意到了这个配置项是一个数组,也就是说可以指定做个组件作为启动点,但是这种用法是很罕见的。

  • 相关阅读:
    svg文件使用highmap显示
    动静分离
    angular 零碎
    使用doxmate生成文档
    javascript之console篇
    java 中String与StringBuilder 效率
    highcharts 组合chart
    js 攻坚克难
    html base 又一重大发现
    sql 分析 依赖beanutils
  • 原文地址:https://www.cnblogs.com/zhouyx/p/14343651.html
Copyright © 2011-2022 走看看