This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/src/app/pages/register.component.ts

21 lines
491 B
TypeScript
Raw Normal View History

import { Component } from '@angular/core';
2017-04-27 22:50:11 +01:00
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/map'
@Component({
templateUrl: 'register.component.html'
})
export class RegisterComponent {
2017-04-27 22:50:11 +01:00
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());
}
}