首页 > 解决方案 > AngularJS:字段被 ng-disabled 禁用,但不能用 ng-hide 隐藏

问题描述

我是 AngularJS 的新手,我有这个疑问:

<select-one options="studentOptions" ng-disabled="student.type == 1"></select-one>

^ 使用上面的代码片段,我可以禁用(或变灰)一堆单选按钮。但我想隐藏那些单选按钮,所以我将其更改为:

<select-one options="studentOptions" ng-hide="student.type == 1"></select-one>

不过,现在已经没有效果了!你能帮我理解我哪里出错了吗?当我将“ng-disabled”更改为“ng-hide”时,我希望这些单选按钮会被隐藏,但我没有得到预期的结果。

标签: htmlangularjs

解决方案


推荐阅读