2
This commit is contained in:
24
src/app/components/show-form/show-form.component.ts
Normal file
24
src/app/components/show-form/show-form.component.ts
Normal file
@ -0,0 +1,24 @@
|
||||
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);
|
||||
|
||||
save() {
|
||||
this.showService.getShows().push(this.show);
|
||||
|
||||
this.show = new Show(null, null);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user