当我通过ng-click设置selectedManager时,为什么我的容器没有显示?

HTML:

<tr ng-repeat="manager in allManagers" ng-click="openDetails(manager)">
<div class="container" ng-show="selectedManager">


JS:

$scope.selectedManager;
$scope.openDetails = function(item) {
  selectedManager = item;
  console.log(selectedManager);
}


Console.log成功打印对象?

最佳答案

您应修改$scope.selectedManager属性:

$scope.openDetails = function (item) {
    $scope.selectedManager = item;
    console.log(selectedManager);
};

08-28 08:42