angular
angular copied to clipboard
[Question] Builder Initialized Output Event
Hi Formio team,
I need the builder instance once the builder is initialized. This is similar to the (ready) event available for <form-builder [form]="formJSON" (ready)="builderLoaded($event)"></form-builder>
So is there any plan to introduce this or any workaround to achieve this.?
You can get it like this.
import { Component, AfterViewInit, ViewChild } from '@angular/core';
import { FormBuilderComponent } from 'angular-formio';
@Component({
template: '<form-builder></form-builder>'
})
export class FormRenderComponent implements AfterViewInit {
@ViewChild(FormBuilderComponent, true) formBuilder: FormBuilderComponent;
ngAfterViewInit() {
this.formBuilder.ready.then((builder) => {
// "builder" is the form builder instance.
console.log(builder);
});
}
}