diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-02-26 21:31:52 -0500 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-02-26 21:31:52 -0500 |
commit | 8811480c199b7b2a97ee0532d3488ed9512b6f37 (patch) | |
tree | 3c32ee0a82516492f0954f88404326e368e4c7f1 /ufund-ui/src/app/components/need-list/need-list.component.ts | |
parent | 8a2d6c332a089c2dbb7351514499e16f343959ff (diff) | |
download | JellySolutions-8811480c199b7b2a97ee0532d3488ed9512b6f37.tar.gz JellySolutions-8811480c199b7b2a97ee0532d3488ed9512b6f37.tar.bz2 JellySolutions-8811480c199b7b2a97ee0532d3488ed9512b6f37.zip |
get angular services working
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/need-list/need-list.component.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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) + } } |