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

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.
主站蜘蛛池模板: 汝南县| 鄂尔多斯市| 杭锦后旗| 吉首市| 边坝县| 武安市| 静乐县| 井陉县| 开阳县| 南阳市| 崇礼县| 辰溪县| 丰镇市| 天峨县| 连云港市| 靖远县| 高要市| 孙吴县| 徐州市| 灌阳县| 温泉县| 定襄县| 嘉善县| 广汉市| 承德县| 大安市| 罗田县| 蕉岭县| 武穴市| 广东省| 江口县| 黑河市| 讷河市| 雷山县| 象山县| 哈尔滨市| 广水市| 潜江市| 浦江县| 寿阳县| 泊头市|