Browse Source

Remove has property check

pull/198/head
Derek Begnoche 8 years ago
parent
commit
9b83e15990
  1. 18
      src/Squidex/app/features/content/pages/content/content-page.component.ts

18
src/Squidex/app/features/content/pages/content/content-page.component.ts

@ -261,17 +261,15 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy,
} }
} else { } else {
for (const field of this.schema.fields) { for (const field of this.schema.fields) {
if (field.properties.hasOwnProperty('defaultValue')) { const defaultValue = field.defaultValue();
const defaultValue = field.defaultValue(); if (defaultValue) {
if (defaultValue) { const fieldForm = <FormGroup>this.contentForm.get(field.name);
const fieldForm = <FormGroup>this.contentForm.get(field.name); if (field.partitioning === 'language') {
if (field.partitioning === 'language') { for (let language of this.languages) {
for (let language of this.languages) { fieldForm.controls[language.iso2Code].setValue(defaultValue);
fieldForm.controls[language.iso2Code].setValue(defaultValue);
}
} else {
fieldForm.controls['iv'].setValue(defaultValue);
} }
} else {
fieldForm.controls['iv'].setValue(defaultValue);
} }
} }
} }

Loading…
Cancel
Save