diff options
author | benal01 <bja4245@rit.edu> | 2025-02-27 19:17:05 -0500 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-02-27 19:17:05 -0500 |
commit | df48929a7deb0dda072206ac5c32744dc95f20c5 (patch) | |
tree | c6e3b91dfbec5a339f84b967665ebf3aa8ce9859 /ufund-ui/src/app/components/cupboard/cupboard.component.ts | |
parent | f33629005913a2f2d6814c9a8686989278f38bb0 (diff) | |
download | JellySolutions-df48929a7deb0dda072206ac5c32744dc95f20c5.tar.gz JellySolutions-df48929a7deb0dda072206ac5c32744dc95f20c5.tar.bz2 JellySolutions-df48929a7deb0dda072206ac5c32744dc95f20c5.zip |
Need class tests
Diffstat (limited to '')
-rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 26 |
1 files changed, 23 insertions, 3 deletions
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); + } + } + } |