javascript - 如何使用 nz-radio-group 以 Angular 显示和隐藏其他项目

标签 javascript angular typescript

代码如下:

list.component.html

   <nz-radio-group formControlName="radiostatus" [(ngModel)]="radioValue" (ngModelChange)="onChangeStatus($event)">
                  <label nz-radio nzValue="passed">Passed</label>
                  <label nz-radio nzValue="failed">Failed</label>
                </nz-radio-group>
 <div>
              <textarea nz-input class="remarks-textarea" type="text" name="otherRemark" formControlName="remark" [(ngModel)]="otherRemark"
                [nzAutosize]="{ minRows: 3, maxRows: 3 }"></textarea>
            </div>

如何显示具有textareadiv,它会在单选按钮中选择时显示失败,当点击通过时,它将隐藏

提前致谢

最佳答案

请找到下图,其中包含所有表单控件和(ngModelChange)。

enter image description here

我认为初始化存在一些问题。如果您能详细说明您的代码,可以帮助您进一步检查。

谢谢。

关于javascript - 如何使用 nz-radio-group 以 Angular 显示和隐藏其他项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59296721/

相关文章:

javascript - 用于选择选择选项和单击按钮的 JQuery 代码不起作用?

javascript - 使用内联编辑器的 Firebase 部署错误

angular - Angular 中不同模块的数组的类型是什么?

node.js - 如何使用 Node Express 访问 "async all the way down"?

javascript - 解释为什么在 Javascript 中 false 和 modulus 总是等同于 true

javascript - Google map MapType 接口(interface)中 maxZoom 属性的用途?

javascript - Rxjs CombineLatest 和 Object.assign 在 @angular/material 源中的使用说明

angular - 如何获得:id param of child route from parent component in Angular2

cordova - 无法在 Visual Studio 2013 中创建 Apache Cordova 项目

javascript - debounceTime 到 CodeMirror Angular