zoukankan      html  css  js  c++  java
  • Angular速查表

    引导/启动

    用NgModule中指定的根组件进行启动

    import { platformBrowerDynamic } from '@angular/platform-browser-dynamic';
    
    platformBrowserDynamic().bootstrapModule(AppModule);

    NgModules

    定义一个模块,其中可以包含组件、指令、管道和服务提供者。

    import { NgModule } from '@angular/core';
    
    @NgModule({
        declarations: ..., 
        imports: ..., 
        exports: ..., 
        providers: ..., 
        bootstrap: ...})
    class MyModule {}

    declarations

    属于当前模块的组件、指令和管道的列表

    declarations: [MyRedComponent, MyBlueComponent, MyDatePipe]

    imports

    本模块所导入的模块列表

    imports: [BrowserModule, SomeOtherModule]

    exports

    哪些导入了本模块的模块所能看到的组件、指令和管道的列表

    exports: [MyRedComponent, MyDatePipe]

    providers

    依赖注入提供者的列表,本模块以及本模块导入的所有模块中的内容都可以看见它们。

    providers: [MyService, { provide: ... }]

    entryComponents

    任何未在可达模板中引用过的组件列表,比如从代码中动态创建的。

    entryComponents: [SomeComponent, OtherComponent]

    bootstrap

    bootstrap: [MyAppComponent]
  • 相关阅读:
    leetcode-剑指10-OK
    leetcode-剑指22-OK
    vue组件引入
    vue项目单页
    vue-cli脚手架创建vue项目
    vue生命周期
    ES6 DEMO
    ES6
    记录一个天坑
    CentOS 7防火墙快速开放端口配置方法
  • 原文地址:https://www.cnblogs.com/cathy1024/p/13257467.html
Copyright © 2011-2022 走看看