FormBuilder -> how to update display type ?
Dears , @travist
I follow this sample ( Builder Demo) to use the new form builder in my angular 5 application.
the builder loaded correctly and I bind the following object to the builder :
formJson: any = {
components: [],
display : 'form'
};
when I change the object after page loaded for ( edit existing component or change display type to wizard ) nothing happend. the builder should be refreshed if the object ( formJson ) changed.!!
Hi @AlameerDev are you able to figure it out. Please share your experience.
Hi @AlameerDev Did you figure it.
I have a work around which is working for me ... But don't know if it's correct way.
<form-builder *ngIf="renderForm" [form]="form" (change)="onChange($event)"></form-builder>
and on change of display following code
displayChange($event) {
this.renderForm=false;
//make any changes to form.
setTimeout(
()=>{this.renderForm=true;}
);
}
hi @AlameerDev , when is exactly your displayChange($event) is called ? Beacuse I tried to do same in onChange($event) and ended up freezing builder.
Closed due to no activity. If the issue is still relevant, please reopen