Upgraded to Angular 14
This commit is contained in:
2022-07-06 09:04:10 +05:30
parent f637f01954
commit 792ccf923f
46 changed files with 233 additions and 179 deletions

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
@ -22,14 +22,14 @@ import { GuestBookListDataSource } from './guest-book-list-datasource';
export class GuestBookListComponent implements OnInit {
data: BehaviorSubject<GuestBook[]> = new BehaviorSubject<GuestBook[]>([]);
dataSource: GuestBookListDataSource = new GuestBookListDataSource(this.data);
form: FormGroup;
form: UntypedFormGroup;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['sno', 'name', 'phone', 'pax', 'date', 'action'];
constructor(
private route: ActivatedRoute,
private router: Router,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private dialog: MatDialog,
private toaster: ToasterService,
private ser: GuestBookService,
@ -42,7 +42,7 @@ export class GuestBookListComponent implements OnInit {
}
listenToDateChange(): void {
(this.form.get('date') as FormControl).valueChanges
(this.form.get('date') as UntypedFormControl).valueChanges
.pipe(map((x) => moment(x).format('DD-MMM-YYYY')))
.subscribe((x) =>
this.ser.list(x).subscribe((list: GuestBookList) => {