我試圖將Objects
傳遞給模態。我不知道如何將參數傳遞給模態。所以我用這個嘗試:傳遞一個對象並將其重新轉換爲角度模態
vm.viewGroupDetail = function(userDetails) {
var scope = $scope.$new();
scope.userDetails = userDetails;
vm.modalInstance = $uibModal.open({
animation: true,
templateUrl: 'app/views/groups/group_details_modal.html',
windowClass: 'd-modal',
size: 'lg',
scope: scope,
resolve: {
userDetails: function() {
return $scope.userDetails;
}
}
});
};
這是我的HTML模式:
<div class="modal-header portlet-title">
<button type="button" class="close" aria-hidden="true" ng-click="$close()">×</button>
<div class="caption font-dark">
<span class="caption-subject bold uppercase"> Group Detail</span>
</div>
</div>
<div class="modal-body">
<div class="portlet light accordian-body inner-datatable" id="demo1">
<div class="portlet-body custom-portlet">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Users </th>
<th> Designation </th>
<th> User Image </th>
</tr>
</thead>
<tbody>
<tr ng-repeat="userdetail in userDetailsList">
<td> {{userdetail.fullName}}</td>
<td> {{userdetail.designation}} </td>
<td> <div class="user-img-holder">{{userdetail.fullName}}</div></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer col-center">
<button type="button" class="btn btn-primary" ng-click="$close()">OK</button>
</div>
我想用傳遞到ng-repeat
條款的對象,這樣我可以在一個數據表顯示,內一種模式形式。
現在,我成功彈出一個模態窗體,但無法獲取對象。
我在做什麼錯?
我已經過了,它是強制性的控制器嗎?如果是這樣,我可以得到一個示例控制器,如何使用它傳遞對象? 感謝您的快速回復,感謝它 –
http://plnkr.co/edit/?p=preview – Grissom
對不起,plunker預覽是爲了? –