aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts18
1 files changed, 10 insertions, 8 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 9ef191a..bf78d99 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 } from '@angular/core';
+import {Component, Input} from '@angular/core';
import { NgForm } from '@angular/forms';
import {Need} from '../../models/Need';
import {CupboardService} from '../../services/cupboard.service';
@@ -15,6 +15,8 @@ export class NeedListComponent {
needs: Need[] = [];
searchResults: Need[] = [];
+ @Input() editF?: Function
+
constructor(
private cupboardService: CupboardService,
private usersService: UsersService
@@ -43,7 +45,7 @@ export class NeedListComponent {
}
if (form) {
this.searchDelay = setTimeout(() => {
-
+
if (form) {
const currentSearchValue = form.search; //latest value of the search
this.cupboardService.searchNeeds(currentSearchValue).subscribe((n) => {
@@ -58,9 +60,9 @@ export class NeedListComponent {
clearTimeout(this.searchDelay);
this.searchResults = this.needs;
}
-
-
+
+
}
delete(id : number) {
@@ -80,10 +82,10 @@ export class NeedListComponent {
}
changeText(id : number, text : string) {
- const span = document.getElementById('hover-status-label-' + id);
+ const span = document.getElementById('hover-status-label-' + id);
if (span) {
span.innerHTML = ' ' + text;
- }
+ }
}
add(need: Need) {
@@ -101,7 +103,7 @@ export class NeedListComponent {
} else {
window.alert("This need is already in your basket!")
}
-
+
}
@@ -140,4 +142,4 @@ export class NeedListComponent {
button.style.visibility = 'hidden';
}
}
-} \ No newline at end of file
+}