Added initial test http request
This commit is contained in:
parent
f3cc47396f
commit
66b3cd6ea4
3 changed files with 19 additions and 7 deletions
|
@ -1,10 +1,20 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map'
|
||||
|
||||
@Component({
|
||||
templateUrl: 'register.component.html'
|
||||
})
|
||||
export class RegisterComponent {
|
||||
private apiurl="https://dev.app.peartrade.org/api"
|
||||
constructor(private http: Http) {
|
||||
|
||||
this.getAges().subscribe(
|
||||
result => {console.log(result)}
|
||||
) }
|
||||
getAges() {
|
||||
return this.http.get(this.apiurl +'/info/ages' ).map((response: Response) => response.json());
|
||||
}
|
||||
|
||||
constructor() { }
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue