File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
src/main/frontend/src/app Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,3 @@ <h1 class="appContent">
5
5
< a class ="btn btn-default " href ="# " role ="button "> Click</ a >
6
6
7
7
< button md-button > Click me!</ button >
8
-
9
- < md-input-container >
10
- < input mdInput placeholder ="Favorite food " value ="Sushi ">
11
- </ md-input-container >
Original file line number Diff line number Diff line change 1
1
import { Component } from "@angular/core" ;
2
2
import { UserService } from "./service/user.service" ;
3
- import { Http } from "@angular/http" ;
3
+ import { HttpClient } from "@angular/common /http" ;
4
4
5
5
@Component ( {
6
6
selector : 'app-root' ,
@@ -9,12 +9,12 @@ import {Http} from "@angular/http";
9
9
providers : [ UserService ]
10
10
} )
11
11
export class AppComponent {
12
- user = { id : 1 , nick : "Jackie" } ;
12
+ user = { } ;
13
13
14
- constructor ( private userService : UserService , http : Http ) {
14
+ constructor ( private userService : UserService , httpClient : HttpClient ) {
15
15
console . log ( "init AppComponent" ) ;
16
16
// remote service
17
- // http .get('/json').subscribe(result => this.user = result.json() );
17
+ httpClient . get ( '/json' ) . subscribe ( result => this . user = result ) ;
18
18
}
19
19
20
20
echo ( ) : string {
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" ;
5
- import { MaterialModule } from "@angular/material" ;
6
-
7
4
import { AppComponent } from "./app.component" ;
8
5
import { HttpClientModule } from "@angular/common/http" ;
9
6
You can’t perform that action at this time.
0 commit comments