官术网_书友最值得收藏!

Angular and the component method for developing modern web applications

Angular components are similar to web components; they are used to compose web pages, or even other components. There can be dozens of components in a web application.

Components define views and templates, and they belong to a module within an application; every application has, at the very least, a root module, named by the Angular CLI as AppModule.ts.

The app.module.ts file contains all of the bootstrap code and configurations for an Angular application, as you can see in the following block of code:

import { NgModule } from '@angular/core';

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

The preceding code is the most basic configuration of an Angular application; we import the NgModule from the Angular core library and use it as a decorator: @NgModule

Both components and services are simply classes, with decorators that mark their types and provide metadata that tells Angular how to use them.

You can read more about web components at  https://www.webcomponents.org/introduction.
主站蜘蛛池模板: 循化| 庆元县| 吴旗县| 西充县| 西昌市| 浦城县| 保德县| 武鸣县| 光泽县| 定西市| 泰州市| 丘北县| 平山县| 漳平市| 太湖县| 冕宁县| 松江区| 东至县| 淮南市| 盐城市| 大田县| 泰安市| 赣榆县| 镇宁| 房山区| 阿克苏市| 丰原市| 类乌齐县| 皮山县| 贵定县| 夏邑县| 遂宁市| 东山县| 筠连县| 谢通门县| 衡东县| 龙门县| 博白县| 洪洞县| 融水| 汕头市|