Skip to content

Commit 1f76a0b

Browse files
committed
change to http client
1 parent d7f92d2 commit 1f76a0b

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/main/frontend/src/app/app.component.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ <h1 class="appContent">
55
<a class="btn btn-default" href="#" role="button">Click</a>
66

77
<button md-button>Click me!</button>
8-
9-
<md-input-container>
10-
<input mdInput placeholder="Favorite food" value="Sushi">
11-
</md-input-container>

src/main/frontend/src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Component} from "@angular/core";
22
import {UserService} from "./service/user.service";
3-
import {Http} from "@angular/http";
3+
import {HttpClient} from "@angular/common/http";
44

55
@Component({
66
selector: 'app-root',
@@ -9,12 +9,12 @@ import {Http} from "@angular/http";
99
providers: [UserService]
1010
})
1111
export class AppComponent {
12-
user = {id: 1, nick: "Jackie"};
12+
user = {};
1313

14-
constructor(private userService: UserService, http: Http) {
14+
constructor(private userService: UserService, httpClient: HttpClient) {
1515
console.log("init AppComponent");
1616
// remote service
17-
// http.get('/json').subscribe(result => this.user = result.json());
17+
httpClient.get('/json').subscribe(result => this.user = result);
1818
}
1919

2020
echo(): string {

src/main/frontend/src/app/app.module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import {BrowserModule} from "@angular/platform-browser";
22
import {NgModule} from "@angular/core";
33
import {FormsModule} from "@angular/forms";
4-
import {HttpModule} from "@angular/http";
5-
import {MaterialModule} from "@angular/material";
6-
74
import {AppComponent} from "./app.component";
85
import {HttpClientModule} from "@angular/common/http";
96

0 commit comments

Comments
 (0)