From 8811480c199b7b2a97ee0532d3488ed9512b6f37 Mon Sep 17 00:00:00 2001 From: sowgro Date: Wed, 26 Feb 2025 21:31:52 -0500 Subject: get angular services working --- ufund-ui/src/app/components/need-list/need-list.component.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts') diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index 61ed089..a3eb072 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -1,4 +1,6 @@ import { Component } from '@angular/core'; +import {Need} from '../../models/Need'; +import {CupboardService} from '../../services/cupboard.service'; @Component({ selector: 'app-need-list', @@ -7,5 +9,13 @@ import { Component } from '@angular/core'; styleUrl: './need-list.component.css' }) export class NeedListComponent { + needs: Need[] = []; + constructor( + private cupboardService: CupboardService + ) {} + + ngOnInit(): void { + this.cupboardService.getNeeds().subscribe(n => this.needs = n) + } } -- cgit v1.2.3