aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-page/need-page.component.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts
index 390bfb6..15c1e87 100644
--- a/ufund-ui/src/app/components/need-page/need-page.component.ts
+++ b/ufund-ui/src/app/components/need-page/need-page.component.ts
@@ -1,5 +1,7 @@
import {Component, Input} from '@angular/core';
import {Need} from '../../models/Need';
+import {ActivatedRoute} from "@angular/router";
+import {CupboardService} from "../../services/cupboard.service";
@Component({
selector: 'app-need-page',
@@ -8,5 +10,15 @@ import {Need} from '../../models/Need';
styleUrl: './need-page.component.css'
})
export class NeedPageComponent {
+ constructor(
+ private route: ActivatedRoute,
+ private cupboardService: CupboardService,
+ ) {}
+
@Input() need?: Need;
+
+ ngOnInit(): void {
+ const id = Number(this.route.snapshot.paramMap.get('id'));
+ this.cupboardService.getNeed(id).subscribe(n => this.need = n);
+ }
}