How to assemble a reactive fomulario through an input radio?

Asked

Viewed 33 times

-1

You guys can help me?

I built a radio component and depending on the value of it will be rendered a new form, follow my HTML

<div class="ui-g-12 ui-md-4 center-zone">
    <msp-radio-group id="caracteristicas" theme="boolean" label="Tem caracteristicas?" (click)="formReactive($event)"></msp-radio-group>
  </div>

  <div class="ui-g-12 ui-md-3" *ngIf="maisCaracteristicas">
    <msp-input-text id="teste" label="teste" tooltip="ajustar"></msp-input-text>
  </div>

And my ts:

formReactive(event: any) {
console.log(event)
if (event.value) {
  this.seguro = true;
}
else {
  this.seguro = false;
}

}

That is, that if the Boolean value is YES he render the field test, otherwise it will not render.

I don’t know what I did wrong, because it’s not working, you can help me?

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.