1
<div class="btn-group dd-rm-action" role="group" aria-label="...">
    <button type="button" class="btn btn-primary dd-action pagination-centered" ng-click="Save()">Save</button>
    <button class="btn btn-default dd-action dropdown-toggle" type="button" id="dropdownState" data-toggle="dropdown" aria-expanded="true" ng-bind="rmCW.State.Name">
        <b class="caret"></b>
    </button>
    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownState">
        <li role="presentation" ng-repeat="task in docState.Tasks">
            <a role="menuitem" tabindex="{{$index}}" href="#" ng-click="execTask(task)">{{task.Name}}</a>
        </li>
    </ul>
</div>

我有一个 angularjs 应用程序可以正常工作,只是在ng-bind我更新范围值后 for 按钮不会更新:

result.then(function (r) {
    $scope.$emit('UNLOAD');
    if (r.status == 0) {
        var cs = JSON.parse(r.data)
        $scope.docState = cs;
        $scope.rmCW.Current = cs;
    }
}
4

1 回答 1

1

很可能是因为ng-bind="rmCW.State.Name"您的范围设置为其他属性。

 $scope.rmCW.Current = cs;

您需要将 ng-bind 设置为ng-bind="rCW.Current.Name",或者您需要将 $scope 设置为$scope.rmCW.State = cs;

于 2015-03-09T20:54:42.470 回答