You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
853 B
31 lines
853 B
import { Component, OnInit, Inject } from '@angular/core';
|
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
import { ApiService } from 'src/app/services/api.service';
|
|
|
|
@Component({
|
|
selector: 'app-new-season-dialog',
|
|
templateUrl: './new-season-dialog.component.html',
|
|
styleUrls: ['./new-season-dialog.component.less']
|
|
})
|
|
export class NewSeasonDialogComponent {
|
|
|
|
constructor(
|
|
public dialogRef: MatDialogRef<NewSeasonDialogComponent>,
|
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
private apiService: ApiService
|
|
) { }
|
|
|
|
ngOnInit(): void {
|
|
}
|
|
|
|
onCancelClick(): void {
|
|
this.dialogRef.close();
|
|
}
|
|
|
|
onSaveClick(): void {
|
|
this.apiService.addSeason(this.data.title, this.data.subtitle, this.data.startDate).subscribe(data => {
|
|
console.log(data);
|
|
});
|
|
this.dialogRef.close(this.data);
|
|
}
|
|
}
|
|
|