diff --git a/aio/content/examples/bootstrapping/src/app/app.module.ts b/aio/content/examples/bootstrapping/src/app/app.module.ts index 9b8a4fcaef..3059978a82 100644 --- a/aio/content/examples/bootstrapping/src/app/app.module.ts +++ b/aio/content/examples/bootstrapping/src/app/app.module.ts @@ -21,11 +21,13 @@ import { ItemDirective } from './item.directive'; ItemDirective ], // #enddocregion declarations + // #docregion imports imports: [ BrowserModule, FormsModule, HttpClientModule ], + // #enddocregion imports providers: [], bootstrap: [AppComponent] }) diff --git a/aio/content/guide/bootstrapping.md b/aio/content/guide/bootstrapping.md index d0faf6d0df..a870d03121 100644 --- a/aio/content/guide/bootstrapping.md +++ b/aio/content/guide/bootstrapping.md @@ -18,8 +18,6 @@ When you use the [Angular CLI](cli) command `ng new` to generate an app, the def /* JavaScript imports */ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; import { AppComponent } from './app.component'; @@ -29,9 +27,7 @@ import { AppComponent } from './app.component'; AppComponent ], imports: [ - BrowserModule, - FormsModule, - HttpClientModule + BrowserModule ], providers: [], bootstrap: [AppComponent] @@ -120,9 +116,6 @@ Now you could use your `ItemDirective` in a component. This example uses `AppMod Remember, components, directives, and pipes belong to one module only. You only need to declare them once in your app because you share them by importing the necessary modules. This saves you time and helps keep your app lean. - - - {@a imports} ## The `imports` array @@ -130,6 +123,12 @@ Remember, components, directives, and pipes belong to one module only. You only The module's `imports` array appears exclusively in the `@NgModule` metadata object. It tells Angular about other NgModules that this particular module needs to function properly. + + + This list of modules are those that export components, directives, or pipes that component templates in this module reference. In this case, the component is `AppComponent`, which references components, directives, or pipes in `BrowserModule`, @@ -138,6 +137,8 @@ A component template can reference another component, directive, or pipe when the referenced class is declared in this module or the class was imported from another module. + + {@a bootstrap-array} ## The `providers` array