Javascript 当单选按钮选择使用angular.js时,如何禁用输入字段

Javascript 当单选按钮选择使用angular.js时,如何禁用输入字段,javascript,angularjs,radio-button,Javascript,Angularjs,Radio Button,我需要一个帮助。当单选按钮被选中时,我需要禁用一些输入字段。让我在下面解释我的代码 <div class="input-group bmargindiv1 col-md-12"> <span class="input-group-addon ndrftextwidth text-right" style="width:180px">Unit Cost Price :</span> <input type="text" name="discount" id

我需要一个帮助。当单选按钮被选中时,我需要禁用一些输入字段。让我在下面解释我的代码

<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Unit Cost Price :</span>
<input type="text" name="discount" id="ucp" class="form-control" placeholder="Add unit cost price" ng-model="unit_cost_price" ng-keypress="clearField('ucp');" ng-readonly="ucpread" ng-disabled="ucpdis">
</div>
<div class="input-group bmargindiv1 col-md-12" >
<input type="radio" name="favoriteColors" ng-model="isChecked.new">Add new stock
<input type="radio" name="favoriteColors" ng-model="isChecked.old">Update stock 
</div>

单价:
新增股票
更新库存

在上面的代码中,我得到的
更新库存
是默认选中的。我需要当用户选择
更新库存
时,上面的
单价
字段将被禁用/只读,当用户选择
添加新库存
时,它将被启用。请帮助我。

给单选按钮赋值,并将其与禁用\启用文本

 <input type="radio" ng-model="isChecked" name="favoriteColors" value="true" />Add new stock
 <input type="radio" ng-model="isChecked" name="favoriteColors" value="false" />Update stock

 <input type="text" ng-disabled="isChecked=='false'">
添加新股票
更新库存

检查此小提琴手:

将值赋予单选按钮,并将其与禁用\启用文本进行比较

 <input type="radio" ng-model="isChecked" name="favoriteColors" value="true" />Add new stock
 <input type="radio" ng-model="isChecked" name="favoriteColors" value="false" />Update stock

 <input type="text" ng-disabled="isChecked=='false'">
添加新股票
更新库存

检查此小提琴手:

try
ng disabled=“isChecked.new”
I已测试但未出现。try
ng disabled=“isChecked.new”
I已测试但未出现。