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', standalone: false, templateUrl: './cupboard.component.html', styleUrl: './cupboard.component.css' }) 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); } } }