blob: 53dad8a9d3c2ac5f91867711e7af4c1549f665f3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
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);
}
}
}
|