在我们的代码库中,更新了一些类属性名称,并且这些类被一些Angular js文件使用。
我已经调试了它,我知道bTargets中有数据,但有人可以解释一下ng-options属性实际上在做什么吗?
<select class="BranchRuleTargetSelect" ng-model="branchTargetID" ng-options="t.ID as t.Text for t in bTargets" />
此选择不输出任何选项,但bTargets对象中有数据。
在bTargets对象中有一个名为ID和Text的属性,所以我想知道是否破坏了表达式,因为它看起来像是在使用某种别名。
让我知道你需要什么角度代码。
surveybuilder.branching.rulesControllerExtender = function ($scope) {
function setBranchTargets() {
$scope.bTargets = $scope.branchTargets.filter(function (x) { return x.ID !== $scope.QuestionnaireItem.Id; });
}
setBranchTargets();
}
答案 0 :(得分:0)
尝试
ng-options="t.Text for t in bTargets track by t.ID"