Use copy instead of new instance.

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

No files matched your search

+1 -1
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;
+1 -1
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;