I have a create message form and sending a few formcontrols and I need to send the createdDt and updated it as a hidden value where it shouldn't show in the angular template. I want to set the current date and time for createdDt and updatedDt
ngOnInit() : void {
this.addMessageForm : this.formBuilder.group({
'messageTitle' : new FormControl(''),
'messageDec' : new FormControl(''),
'messageSentBy' : new FormControl(''),
'createdDt' : ?
'updateDt' : ?
})
createMessage(this.addMessageForm.value).subscribe(data=> {
console.log("Message Created Successfully")
} ,err => {
console.log("Message Failed to Create")
})
}