angular icon indicating copy to clipboard operation
angular copied to clipboard

FormBuilder -> how to update display type ?

Open AlameerDev opened this issue 8 years ago • 4 comments

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.!!

AlameerDev avatar May 20 '18 12:05 AlameerDev

Hi @AlameerDev are you able to figure it out. Please share your experience.

bmadhan90 avatar Jun 28 '18 10:06 bmadhan90

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;} ); }

lcharanteja avatar Jul 02 '18 17:07 lcharanteja

hi @AlameerDev , when is exactly your displayChange($event) is called ? Beacuse I tried to do same in onChange($event) and ended up freezing builder.

IParthJoshi avatar Jun 26 '19 09:06 IParthJoshi

Closed due to no activity. If the issue is still relevant, please reopen

HannaKurban avatar Aug 31 '23 13:08 HannaKurban