From 9b83e1599064e9e19c38c6a67deb764dfc58a98c Mon Sep 17 00:00:00 2001 From: Derek Begnoche Date: Thu, 30 Nov 2017 20:50:25 -0600 Subject: [PATCH] Remove has property check --- .../pages/content/content-page.component.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Squidex/app/features/content/pages/content/content-page.component.ts b/src/Squidex/app/features/content/pages/content/content-page.component.ts index 0cde3d13c..9f8569299 100644 --- a/src/Squidex/app/features/content/pages/content/content-page.component.ts +++ b/src/Squidex/app/features/content/pages/content/content-page.component.ts @@ -261,17 +261,15 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy, } } else { for (const field of this.schema.fields) { - if (field.properties.hasOwnProperty('defaultValue')) { - const defaultValue = field.defaultValue(); - if (defaultValue) { - const fieldForm = this.contentForm.get(field.name); - if (field.partitioning === 'language') { - for (let language of this.languages) { - fieldForm.controls[language.iso2Code].setValue(defaultValue); - } - } else { - fieldForm.controls['iv'].setValue(defaultValue); + const defaultValue = field.defaultValue(); + if (defaultValue) { + const fieldForm = this.contentForm.get(field.name); + if (field.partitioning === 'language') { + for (let language of this.languages) { + fieldForm.controls[language.iso2Code].setValue(defaultValue); } + } else { + fieldForm.controls['iv'].setValue(defaultValue); } } }