Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Project Modal Set up
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FormGroup, FormBuilder, FormArray, FormControl } from '@angular/forms';
@Component({
selector: 'app-project-modal',
templateUrl: './project-modal.component.html',
styleUrls: ['./project-modal.component.scss']
})
export class ProjectInputModalComponent implements OnInit {
taskForm: FormGroup;
dayOfWeek: string;
timesheetHours: number;
projectDesc: string;
client: string;
enteredHours: number = 0;
hoursExceedTimesheet: boolean = false;
tasks = [];
storageKey: string;
taskSeq: number = 0;
taskData: any;
taskDate: Date;
constructor(
public dialogRef: MatDialogRef<ProjectInputModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private fb: FormBuilder,
) { }
ngOnInit(): void {
this.setDataFromParent();
this.createForm();
this.patchValues();
this.checkForData();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment