Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, FormArray, FormControl, Validators } from '@angular/forms';
@Component({
selector: 'app-project-timesheet',
templateUrl: './project-timesheet.component.html',
styleUrls: ['./project-timesheet.component.scss']
})
export class ProjectTimesheetComponent implements OnInit {
sunday: Date; monday: Date; tuesday: Date;
wednesday: Date; thursday: Date; friday: Date;
saturday: Date;
projectTimesheet = [];
projectWeekTotals = [];
projectForm: FormGroup;
tasksForm: FormGroup;
@Output() project = new EventEmitter();
constructor(
private fb: FormBuilder
) { }
ngOnInit(): void {
this.createForm();
}
createForm() {
this.projectForm = this.fb.group({
projectTime: this.fb.array([])
})
this.setWeekTotals();
this.onChanges();
}
initDataSource(data: any) {
this.projectTimesheet = data.projectTime;
this.addProjects();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment