Chore: Removed Mat Card from everywhere.
Chore: Removed the Toaster Service. Chore: Updated to Material Theme 3
This commit is contained in:
@@ -2,16 +2,15 @@ import { CurrencyPipe } from '@angular/common';
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import moment from 'moment';
|
||||
|
||||
import { ToasterService } from '../core/toaster.service';
|
||||
import { ToCsvService } from '../shared/to-csv.service';
|
||||
import { DiscountReport } from './discount-report';
|
||||
import { DiscountReportDataSource } from './discount-report-datasource';
|
||||
@@ -24,7 +23,7 @@ import { DiscountReportService } from './discount-report.service';
|
||||
imports: [
|
||||
CurrencyPipe,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
|
||||
MatDatepickerModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
@@ -37,7 +36,7 @@ export class DiscountReportComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private toCsv = inject(ToCsvService);
|
||||
private toaster = inject(ToasterService);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private ser = inject(DiscountReportService);
|
||||
|
||||
info: DiscountReport = new DiscountReport();
|
||||
@@ -92,10 +91,10 @@ export class DiscountReportComponent implements OnInit {
|
||||
print() {
|
||||
this.ser.print(this.info.startDate, this.info.finishDate).subscribe({
|
||||
next: () => {
|
||||
this.toaster.show('', 'Successfully Printed');
|
||||
this.snackBar.open('Successfully Printed', '');
|
||||
},
|
||||
error: (error) => {
|
||||
this.toaster.show('Error', error);
|
||||
this.snackBar.open(error, 'Error');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user