Use copy instead of new instance.

This commit is contained in:
Alexis Lahouze 2017-08-13 14:17:05 +02:00
parent 13670f0317
commit c3e785122b
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export class AccountEditModalComponent {
submit(): void {
let formModel = this.accountForm.form.value;
let account = new Account();
let account = Object.assign({}, this.account);
account.id = this.account.id;
account.name = formModel.name;

View File

@ -46,7 +46,7 @@ export class ScheduleEditModalComponent {
submit(): void {
let formModel = this.scheduleForm.form.value;
let schedule = new Schedule();
let schedule = Object.assign({}, this.schedule);
schedule.id = this.schedule.id;
schedule.start_date = formModel.startDate;