diff options
| author | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-02-27 21:03:35 -0500 | 
|---|---|---|
| committer | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-02-27 21:03:35 -0500 | 
| commit | 79d8806a34abe980093fb4b48806a57e27e28365 (patch) | |
| tree | 9b93e305367f834d24505b9d74e4100efeb441a2 /ufund-ui/src/app/components | |
| parent | b04d873dfd757e1130845678a57ad8cf818b692e (diff) | |
| parent | df48929a7deb0dda072206ac5c32744dc95f20c5 (diff) | |
| download | JellySolutions-79d8806a34abe980093fb4b48806a57e27e28365.tar.gz JellySolutions-79d8806a34abe980093fb4b48806a57e27e28365.tar.bz2 JellySolutions-79d8806a34abe980093fb4b48806a57e27e28365.zip  | |
Merge branch 'main' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b
Diffstat (limited to '')
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.html | 17 | ||||
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 26 | 
2 files changed, 39 insertions, 4 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index 056c167..ad8e60c 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.html +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html @@ -1,2 +1,17 @@ -<p>cupboard works!</p> +<h1> Cupboard </h1> +<form> +    <label for="name">Name:</label><br> +    <input #name type="text" name="name"><br> +    <label for="id">Id:</label><br> +    <input #id type="number" name="id"><br> +    <label for="max-goal">Max Goal:</label><br> +    <input #maxgoal type="number" name="max-goal"><br> +    <label>Type</label><br> +    <input id="monetary" type="radio" name="type" value="MONETARY"> +    <label for="monetary">Monetary</label><br> +    <input #physical type="radio" name="type" value="PHYSICAL"> +    <label for="physical">Physical</label><br>    +</form> +<button (click)="submit(name.value, id.valueAsNumber, maxgoal.valueAsNumber, physical.value)">Submit</button> +  <app-need-list></app-need-list> diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index c78434e..53dad8a 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -1,4 +1,8 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { CupboardService } from '../../services/cupboard.service'; +import { NeedListComponent } from '../need-list/need-list.component'; + +import { Need, GoalType } from '../../models/Need';  @Component({    selector: 'app-cupboard', @@ -6,6 +10,22 @@ import { Component } from '@angular/core';    templateUrl: './cupboard.component.html',    styleUrl: './cupboard.component.css'  }) -export class CupboardComponent { +export class CupboardComponent implements  +  OnInit { + +    constructor(private cupboardService: CupboardService){} +    ngOnInit() { -} +       +    } +    need!: Need; +    submit(name: string, id: number, maxGoal: number, type: string) { +      if (this.need) { +        this.need.name = name; +        this.need.id = id; +        this.need.maxGoal = maxGoal; +        console.log(type); +        this.cupboardService.createNeed(this.need); +      } +    } +  }  | 
