Skip to content

Instantly share code, notes, and snippets.

@chasebaker21
Created November 19, 2020 15:35
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/b3842bc335077ab87adb6cf7ad3e087f to your computer and use it in GitHub Desktop.
Save chasebaker21/b3842bc335077ab87adb6cf7ad3e087f to your computer and use it in GitHub Desktop.
// sets form array data for tasks
initTaskInfo(tasks: TaskInfoProject[]): FormArray {
const taskArray = this.fb.array([]);
tasks.forEach(d => {
taskArray.push(this.fb.group({
comments: new FormControl(d.comments),
hours: new FormControl(d.hours),
statusReportFlag: new FormControl(d.statusReportFlag),
taskCategoryId: new FormControl(d.taskCategoryId),
taskDesc: new FormControl(d.taskDesc),
taskSeq: new FormControl(d.taskSeq)
}))
})
return taskArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment