33 lines
648 B
TypeScript
33 lines
648 B
TypeScript
import { Inject, Component, OnInit, OnDestroy } from '@angular/core';
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
import { NgForm } from '@angular/forms';
|
|
|
|
@Component({
|
|
selector: 'name-dialog',
|
|
templateUrl: './namedialog.component.html'
|
|
})
|
|
|
|
export class NameDialogComponent implements OnInit{
|
|
bizname: string = '';
|
|
|
|
constructor(
|
|
private dialogRef: MatDialogRef<NameDialogComponent>
|
|
) {
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
|
|
save(form: NgForm) {
|
|
if (form.invalid) {
|
|
return;
|
|
}
|
|
this.dialogRef.close(form.value.bizname);
|
|
//console.log(`Saving name ${form.value.bizname}`);
|
|
}
|
|
|
|
close() {
|
|
this.dialogRef.close();
|
|
}
|
|
}
|