Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions projects/angular-formio/src/FormioBaseComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
setForm(form: FormioForm) {
this.form = form;
if (this.formio) {
this.formio.destroy();
this.formio.destroy(true);
}

if (this.form.title) {
Expand Down Expand Up @@ -285,24 +285,24 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
}
}

setFormFromSrc() {
setFormFromSrc() {
// if a submission is provided, load it first to set required form revision.
if (
isEmpty(this.submission) &&
this.service &&
this.service.formio.submissionId
) {
this.service.loadSubmission().subscribe(
(submission: any) => {
if (
isEmpty(this.submission) &&
this.service &&
this.service.formio.submissionId
) {
this.service.loadSubmission().subscribe(
(submission: any) => {
this.loadForm(() => {
if (this.readOnly) {
this.formio.options.readOnly = true;
}
this.submission = this.formio.submission = submission;
if (this.readOnly) {
this.formio.options.readOnly = true;
}
this.submission = this.formio.submission = submission;
});
},
err => this.onError(err)
);
},
err => this.onError(err)
);
} else {
this.loadForm();
}
Expand All @@ -326,7 +326,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {

ngOnDestroy() {
if (this.formio) {
this.formio.destroy();
this.formio.destroy(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import { CustomTagsService } from '../../custom-tags.service';

/* tslint:disable */
@Component({
selector: 'form-builder',
templateUrl: './formbuilder.component.html',
styleUrls: ['../../../../../node_modules/@formio/js/dist/formio.builder.min.css'],
selector: 'form-builder',
templateUrl: './formbuilder.component.html',
styleUrls: ['../../../../../node_modules/@formio/js/dist/formio.builder.min.css'],
encapsulation: ViewEncapsulation.None
})
/* tslint:enable */
Expand Down Expand Up @@ -207,7 +207,7 @@ export class FormBuilderComponent implements OnInit, OnChanges, OnDestroy {
}

if (this.formio) {
this.formio.destroy();
this.formio.destroy(true);
}
}
}
Loading