<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
不会更新:
result.then(function (r) {
$scope.$emit('UNLOAD');
if (r.status == 0) {
var cs = JSON.parse(r.data)
$scope.docState = cs;
$scope.rmCW.Current = cs;
}
}
最佳答案
很可能是因为 ng-bind="rmCW.State.Name"
并且您的范围设置为其他属性。
$scope.rmCW.Current = cs;
您需要将 ng-bind 设置为 ng-bind="rCW.Current.Name"
,或者需要将 $scope 设置为 $scope.rmCW.State = .cs;
关于javascript - AngularJS ng-bind 没有更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28951391/