aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/need-list')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts8
1 files changed, 5 insertions, 3 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 bf78d99..2eed87d 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,4 @@
-import {Component, Input} from '@angular/core';
+import {Component, Output, EventEmitter} from '@angular/core';
import { NgForm } from '@angular/forms';
import {Need} from '../../models/Need';
import {CupboardService} from '../../services/cupboard.service';
@@ -11,11 +11,11 @@ import { userType } from '../../models/User';
styleUrl: './need-list.component.css'
})
export class NeedListComponent {
- selectedNeed: Need | undefined;
+ selectedNeed: Need | null = null;
needs: Need[] = [];
searchResults: Need[] = [];
- @Input() editF?: Function
+ @Output() currentNeed = new EventEmitter<Need>();
constructor(
private cupboardService: CupboardService,
@@ -114,6 +114,8 @@ export class NeedListComponent {
}
select(need : Need) {
+ //emit value
+ this.currentNeed.emit(need);
if (this.selectedNeed) {
//revert already selected need to previous style
console.log(need.id);