From c77d5fd25eb151a5f2d499ab0974ec1369d5301d Mon Sep 17 00:00:00 2001 From: Cathy Hu Date: Mon, 17 Aug 2020 16:09:07 +0200 Subject: [PATCH] [frontend] Add minimal example for fetching hood list --- .../src/app/hoodspage/hoodspage.component.html | 2 +- .../src/app/hoodspage/hoodspage.component.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.html b/kibicara-frontend/src/app/hoodspage/hoodspage.component.html index 7f50be3..9298696 100644 --- a/kibicara-frontend/src/app/hoodspage/hoodspage.component.html +++ b/kibicara-frontend/src/app/hoodspage/hoodspage.component.html @@ -1 +1 @@ -

hoodspage works!

+
{{ item.name }}
diff --git a/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts b/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts index 292a8f4..9d700d0 100644 --- a/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts +++ b/kibicara-frontend/src/app/hoodspage/hoodspage.component.ts @@ -1,15 +1,15 @@ import { Component, OnInit } from '@angular/core'; +import { HoodsService } from '../api/api/hoods.service'; @Component({ selector: 'app-hoodspage', templateUrl: './hoodspage.component.html', - styleUrls: ['./hoodspage.component.scss'] + styleUrls: ['./hoodspage.component.scss'], }) export class HoodspageComponent implements OnInit { + hoods$ = this.hoodsService.getHoods(); - constructor() { } - - ngOnInit(): void { - } + constructor(private readonly hoodsService: HoodsService) {} + ngOnInit(): void {} }