嗨,我是角度js的初学者。我想知道是否可以为选择框提供动态更改名称。在我的情况下,有多个选择框使用ng-repeat创建并使用相同的ng-change方法名称,因此,当我单击一个选择框时,它会影响另一个不应发生的选择框。
我正在看这样的事情
<div ng-repeat="country in selectCountryList track by $index" >
<select ng-change="formulaSelect{{index}}()" ng-model="filterCondition.operator" ng-options="operator.value as operator.displayName for operator in formulaType" ></select>
</div>
</div>
这是我的js文件的一部分
$scope.formulaType = [{value: 'single', displayName: 'Single Formula'},
{value: 'double', displayName: 'double Formula'}]
$scope.filterCondition={ operator: 'double' };
$scope.countryList = ["AUS","BEL","BUL","CZE","FRA","GER","HOL","HUN"];
$scope.formulaSelect<how to write this function> = function(){
}
是否可能像上面的代码一样。 如果是,而不是如何对其采取行动
由于