Skip to content

Instantly share code, notes, and snippets.

@chasebaker21
Created November 23, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasebaker21/9603bf10c53b2865842920cd37e49eb6 to your computer and use it in GitHub Desktop.
Save chasebaker21/9603bf10c53b2865842920cd37e49eb6 to your computer and use it in GitHub Desktop.
// creates a form after checking the tasks length in order to start setting
// the taskSeq number properly
createForm() {
if (this.tasks.length === 0) {
this.taskSeq = 1;
}
this.taskForm = this.fb.group({
comments: new FormControl(null),
day: new FormControl(null),
hours: new FormControl(null),
oldHours: new FormControl(null),
open: new FormControl(null),
tasks: this.fb.array([
this.fb.group({
taskDesc: '',
taskSeq: this.taskSeq,
hours: 0,
comments: '',
statusReportFlag: true,
taskCategoryId: 0
})
])
})
this.onChanges();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment