aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.ts
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-03-26 18:23:17 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-03-26 18:23:17 -0400
commit0829feb20e60bc6d323dcc0d9376f4feb45115eb (patch)
tree7ba0e9faf51a03127429689eff202c99d3f01fc4 /ufund-ui/src/app/components/need-list/need-list.component.ts
parentd9eb78521f29ead3a9f70b09e18a6d9560cc849c (diff)
downloadJellySolutions-0829feb20e60bc6d323dcc0d9376f4feb45115eb.tar.gz
JellySolutions-0829feb20e60bc6d323dcc0d9376f4feb45115eb.tar.bz2
JellySolutions-0829feb20e60bc6d323dcc0d9376f4feb45115eb.zip
Push starter code for Input()
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.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
+}