aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.html
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-03-22 11:58:39 -0400
committerbenal01 <bja4245@rit.edu>2025-03-22 11:58:39 -0400
commit2abd4b4ba9171821ac545f8dcb67be1e7d722e01 (patch)
tree95c50466a52c3102dc67133821ca03fa3c80ff55 /ufund-ui/src/app/components/cupboard/cupboard.component.html
parent2b67bd14828c8c0bffe461a66542a2dba6c19f93 (diff)
downloadJellySolutions-2abd4b4ba9171821ac545f8dcb67be1e7d722e01.tar.gz
JellySolutions-2abd4b4ba9171821ac545f8dcb67be1e7d722e01.tar.bz2
JellySolutions-2abd4b4ba9171821ac545f8dcb67be1e7d722e01.zip
replaced unneccicary methods for form selection with ngIf
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.html')
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.html12
1 files changed, 5 insertions, 7 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html
index 4577844..41bb4a7 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.html
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html
@@ -5,10 +5,10 @@
<div *ngIf="isManager()" >
<h2 > Admin View </h2>
<div id="menu">
- <button (click)="opencreate()">Create new Need</button>
- <button (click)="openupdate()">Update existing Need</button>
+ <button (click)="selectForm('create')">Create new Need</button>
+ <button (click)="selectForm('update')">Update existing Need</button>
</div>
- <div id="create-form">
+ <div id="create-form" *ngIf="selectedForm === 'create'">
<h1> Create a new need </h1>
<form #cupboardForm="ngForm" (ngSubmit)="submit(cupboardForm.value)">
<label>Name:</label><br>
@@ -22,11 +22,10 @@
<label>Physical</label><br>
<input type="submit" value="Submit">
</form>
- <button (click)="back()">Close</button>
- <span *ngIf="statusText">‼️{{statusText | async}}</span>
+ <span *ngIf="statusText">{{statusText | async}}</span>
</div>
- <div id="update-form">
+ <div id="update-form" *ngIf="selectedForm === 'update'">
<h1> Update a need </h1>
<label>Needs:</label><br>
<form #updateForm="ngForm" (ngSubmit)="update(updateForm.value)">
@@ -46,7 +45,6 @@
<label>Physical</label><br>
<input type="submit" value="Submit">
</form>
- <button (click)="back()">Close</button>
<span *ngIf="statusText">{{statusText | async}}</span>
</div>