123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { Component } from '@angular/core';
- import { Location } from '@angular/common';
- import { MatDialog } from '@angular/material';
- import { ReportDataService } from './services/reportData.service';
- import 'rxjs/add/operator/switchMap';
- import { BaseReportComponent } from './base-report.component';
- import { NewReport } from './types';
- @Component({
- selector: 'ps-report',
- templateUrl: './report.component.html',
- styleUrls: ['./report.component.css']
- })
- export class CreateReportComponent extends BaseReportComponent {
- title = 'Create new expense report';
- constructor(location: Location,
- dialog: MatDialog,
- reportDataService: ReportDataService) {
- super(location, dialog, reportDataService);
- }
- save(): void {
- const newReport: NewReport = {
- date: new Date(),
- approved: false,
- description: this.description,
- items: this.itemsDataBase.data
- };
- this.reportDataService.add(newReport);
- this.location.back();
- }
- // Example of how to use our intersection types. Does nothing.
- dragStart(event: DragStartEvent) {
- event.dragStart.posX;
- }
- dragStop(event: DragStopEvent) {
- event.dragStop.posY;
- }
- }
|