Files
tv-site/src/app/components/show-form/show-form.component.ts
Phan Huy Tran ed06f5d1ca delete
2024-11-20 10:20:42 +01:00

26 lines
630 B
TypeScript

import {Component, inject} from '@angular/core';
import {ShowService} from '../../services/show.service';
import {Show} from '../../model/show';
import {FormsModule} from '@angular/forms';
@Component({
selector: 'app-show-form',
standalone: true,
imports: [
FormsModule
],
templateUrl: './show-form.component.html',
styleUrl: './show-form.component.css'
})
export class ShowFormComponent {
showService: ShowService = inject(ShowService);
show: Show = new Show(null, null);
shows: Show[] = this.showService.getShows();
save() {
this.shows.push(this.show);
this.show = new Show(null, null);
}
}