GeezerVison is showing github.com — docs: update docs to use HttpClientModule instead of HttpModule · angular/angular@4d33477
File treeExpand file treeCollapse file tree Open diff view settings dependency-injection-in-action/src/app lazy-loading-ngmodules/src/app
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/bootstrapping/src/app/app.module.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 | import { BrowserModule } from '@angular/platform-browser'; | 6 | 6 | import { NgModule } from '@angular/core'; | 7 | 7 | import { FormsModule } from '@angular/forms'; | 8 | | -import { HttpModule } from '@angular/http'; | | 8 | +import { HttpClientModule } from '@angular/common/http'; | 9 | 9 |
| 10 | 10 | import { AppComponent } from './app.component'; | 11 | 11 | // #docregion directive-import | @@ -24,7 +24,7 @@ import { ItemDirective } from './item.directive'; | 24 | 24 | imports: [ | 25 | 25 | BrowserModule, | 26 | 26 | FormsModule, | 27 | | - HttpModule | | 27 | + HttpClientModule | 28 | 28 | ], | 29 | 29 | providers: [], | 30 | 30 | bootstrap: [AppComponent] | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/dependency-injection-in-action/src/app/app.module.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | // #docregion | 2 | 2 | import { BrowserModule } from '@angular/platform-browser'; | 3 | 3 | import { FormsModule } from '@angular/forms'; | 4 | | -import { HttpModule } from '@angular/http'; | | 4 | +import { HttpClientModule } from '@angular/common/http'; | 5 | 5 |
| 6 | 6 | // import { AppRoutingModule } from './app-routing.module'; | 7 | 7 | import { LocationStrategy, | @@ -54,7 +54,7 @@ const c_components = [ | 54 | 54 | imports: [ | 55 | 55 | BrowserModule, | 56 | 56 | FormsModule, | 57 | | - HttpModule, | | 57 | + HttpClientModule, | 58 | 58 | InMemoryWebApiModule.forRoot(HeroData) | 59 | 59 | // AppRoutingModule TODO: add routes | 60 | 60 | ], | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/feature-modules/src/app/app.module.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | import { BrowserModule } from '@angular/platform-browser'; | 4 | 4 | import { NgModule } from '@angular/core'; | 5 | 5 | import { FormsModule } from '@angular/forms'; | 6 | | -import { HttpModule } from '@angular/http'; | | 6 | +import { HttpClientModule } from '@angular/common/http'; | 7 | 7 |
| 8 | 8 | import { AppComponent } from './app.component'; | 9 | 9 | // import the feature module here so you can add it to the imports array below | @@ -17,7 +17,7 @@ import { CustomerDashboardModule } from './customer-dashboard/customer-dashboard | 17 | 17 | imports: [ | 18 | 18 | BrowserModule, | 19 | 19 | FormsModule, | 20 | | - HttpModule, | | 20 | + HttpClientModule, | 21 | 21 | CustomerDashboardModule // add the feature module here | 22 | 22 | ], | 23 | 23 | providers: [], | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/lazy-loading-ngmodules/src/app/app.module.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { BrowserModule } from '@angular/platform-browser'; | 2 | 2 | import { NgModule } from '@angular/core'; | 3 | 3 | import { FormsModule } from '@angular/forms'; | 4 | | -import { HttpModule } from '@angular/http'; | | 4 | +import { HttpClientModule } from '@angular/common/http'; | 5 | 5 | import { AppRoutingModule } from './app-routing.module'; | 6 | 6 |
| 7 | 7 | import { AppComponent } from './app.component'; | @@ -13,7 +13,7 @@ import { AppComponent } from './app.component'; | 13 | 13 | imports: [ | 14 | 14 | BrowserModule, | 15 | 15 | FormsModule, | 16 | | - HttpModule, | | 16 | + HttpClientModule, | 17 | 17 | AppRoutingModule | 18 | 18 | ], | 19 | 19 | providers: [], | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/ngmodules/src/app/app.module.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { BrowserModule } from '@angular/platform-browser'; | 2 | 2 | import { NgModule } from '@angular/core'; | 3 | 3 | import { FormsModule } from '@angular/forms'; | 4 | | -import { HttpModule } from '@angular/http'; | | 4 | +import { HttpClientModule } from '@angular/common/http'; | 5 | 5 |
| 6 | 6 | /* App Root */ | 7 | 7 | import { AppComponent } from './app.component'; | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/examples/styleguide/src/app/app.module.ts +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { NgModule } from '@angular/core'; | 2 | | -import { BrowserModule } from '@angular/platform-browser'; | | 2 | +import { BrowserModule } from '@angular/platform-browser'; | 3 | 3 |
| 4 | | -import { HttpModule } from '@angular/http'; | | 4 | +import { HttpClientModule } from '@angular/common/http'; | 5 | 5 | import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; | 6 | 6 |
| 7 | 7 | import { RouterModule } from '@angular/router'; | @@ -44,7 +44,7 @@ import * as s0901 from '../09-01/app/app.module'; | 44 | 44 | @NgModule({ | 45 | 45 | imports: [ | 46 | 46 | BrowserModule, | 47 | | - HttpModule, | | 47 | + HttpClientModule, | 48 | 48 | InMemoryWebApiModule.forRoot(HeroData), | 49 | 49 |
| 50 | 50 | s0101.AppModule, | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/guide/bootstrapping.md +4-7Lines changed: 4 additions & 7 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,8 +18,7 @@ If you use the CLI to generate an app, the default `AppModule` is as follows: | 18 | 18 | /* JavaScript imports */ | 19 | 19 | import { BrowserModule } from '@angular/platform-browser'; | 20 | 20 | import { NgModule } from '@angular/core'; | 21 | | -import { FormsModule } from '@angular/forms'; | 22 | | -import { HttpModule } from '@angular/http'; | | 21 | + | 23 | 22 |
| 24 | 23 | import { AppComponent } from './app.component'; | 25 | 24 |
| @@ -29,9 +28,7 @@ import { AppComponent } from './app.component'; | 29 | 28 | AppComponent | 30 | 29 | ], | 31 | 30 | imports: [ | 32 | | - BrowserModule, | 33 | | - FormsModule, | 34 | | - HttpModule | | 31 | + BrowserModule | 35 | 32 | ], | 36 | 33 | providers: [], | 37 | 34 | bootstrap: [AppComponent] | @@ -137,8 +134,8 @@ It tells Angular about other NgModules that this particular module needs to func | 137 | 134 |
| 138 | 135 | This list of modules are those that export components, directives, or pipes | 139 | 136 | that the component templates in this module reference. In this case, the component is | 140 | | -`AppComponent`, which references components, directives, or pipes in `BrowserModule`, | 141 | | -`FormsModule`, or `HttpModule`. | | 137 | +`AppComponent`, which references components, directives, or pipes in `BrowserModule`. | | 138 | +Other common components in the examples are `FormsModule` and `HttpClientModule`. | 142 | 139 | A component template can reference another component, directive, | 143 | 140 | or pipe when the referenced class is declared in this module or | 144 | 141 | the class was imported from another module. | |
Collapse file Copy file name to clipboardExpand all lines: aio/content/guide/entry-components.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,7 @@ The following is an example of specifying a bootstrapped component, | 36 | 36 | imports: [ | 37 | 37 | BrowserModule, | 38 | 38 | FormsModule, | 39 | | - HttpModule, | | 39 | + HttpClientModule, | 40 | 40 | AppRoutingModule | 41 | 41 | ], | 42 | 42 | providers: [], | |
|