How can I use the value from a subscription to set the property for returning date and time?
Component
ngOnInit() {
this.resetForm();
let defaultWIPEndTime = this.service.getDefaultWIPEndTime().subscribe(res => {});
console.log(defaultWIPEndTime);
}
resetForm(form?: NgForm) {
if (form != null)
form.form.reset();
this.service.plan = {
Id: 0,
Name: '',
Description: '',
CreatedOn: this.defaultWIPEndTime ,
}
}
Subscribe Return
{$id: "20", DefaultWIPEndTime: "17:30:00"}
I Need Put Value 17:30:00
on Property CreatedOn
= What I Need =
this.service.plan = {
Id: 0,
Name: '',
Description: '',
CreatedOn: 17:30:00, <=======================
}
I have Another Question How Subscribe return Just Time. Now It Returns As An Object
= Now Result =
this.service.plan = {
Id: 0,
Name: '',
Description: '',
CreatedOn: {$id: "20", DefaultWIPEndTime: "17:30:00"}, <=======================
}