Skip to content

Instantly share code, notes, and snippets.

@chasebaker21
Last active November 23, 2020 18:56
Show Gist options
  • Save chasebaker21/6bd196852a927813802307f6eabfb542 to your computer and use it in GitHub Desktop.
Save chasebaker21/6bd196852a927813802307f6eabfb542 to your computer and use it in GitHub Desktop.
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