我正在使用手风琴angularjs库。它上面有transclude:true
。
我有一个使用插值{{variable}}
显示的范围变量。当我单击单选按钮时,它显示的值应该会更改。
我在加载时设置了默认的单选按钮和默认变量值。但是,当我单击其他单选按钮时,它不会在插值中显示相应的值。
此方法在与库一起使用之前有效。我读到transclude
创建了一个新范围。
我该如何进行这项工作?
<collapsible-item item-title="Configure Maintenance Bill">
<div class="col-md-3">
<!-- Group of material radios - option 1 -->
<div class="form-check">
<input type="radio" class="form-check-input" id="x" name="groupOfMaterialRadios" ng-checked="maintenance_bill_rate_type ==='3' && maintenance_bill_rate_type==='4'"
ng-model="type" value="expense" ng-change="setCorpusFundDetFn('expense')">
<label class="form-check-label" for="materialGroupExample1">Expenses</label>
</div>
</div>
<div class="row">
<div class="col-md-3">
<label>
<input type="radio" name="optradio" ng-model="maintenance_bill_rate_type" ng-disabled="type!='expense'"
value="3" ng-change="setCorpusFundDetFn()">
</label>
<span class="align-middle">Per Flat</span>
</div>
<div class="col-md-3">
<label>
<input type="radio" name="optradio" ng-model="maintenance_bill_rate_type" value="4" ng-disabled="type!='expense'"
ng-change="setCorpusFundDetFn()">
</label>
<span class="align-middle">Per Sqft</span>
</div>
<div class="col-md-4">
<div ng-class="{'has-error': maintenanceBillForm.corpusFundnm.$invalid && maintenanceBillForm.$submitted}">
<div class="input-group mb-3">
<input type="text" class="form-control" ng-model="carpus_fund" ng-pattern="/^(\d)+$/" placeholder="Enter Corpus Fund"
aria-describedby="basic-addon2 " name="corpusFundnm" required >
<div class="input-group-addon">
<span class="input-group-text" id="basic-addon3">{{corpusFundDet || 'wt'}}</span>
</div>
</div>
</div>
</div>
</div>
<collapsible-item>