0

Objects을 모달로 전달하려고합니다. 나는 모달로 논쟁을 어떻게 전달할 지 모른다. 내부에, 나는 데이터 테이블 내에서 표시 할 수 있도록 내가는 ng-repeat 절에 전달 된 개체를 사용할개체 전달 및 모달 모달로 돌아 가기

<div class="modal-header portlet-title"> 
    <button type="button" class="close" aria-hidden="true" ng-click="$close()">&times;</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> 

:

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입니다 : 그래서 나는이 함께 노력하고 있습니다 모달 형식.

지금 모달 형식을 성공적으로 팝핑했지만 개체를 ​​가져올 수 없습니다.

내가 뭘 잘못하고 있니?

답변

0

당신은 내 모달 기능은 다음과 같이 간다

,

+0

나는 그것을 끝내었다. 그리고 그것을 위해 컨트롤러가 반드시 있어야 하는가? 그렇다면 예제 컨트롤러를 사용할 수 있습니까? 객체를 어떻게 사용합니까? 답장을 보내 주셔서 감사합니다. –

+0

http://plnkr.co/edit/?p=preview – Grissom

+0

죄송합니다, 미리보기는 도움이 되었습니까? –

0

은 다행 내가 대답으로 나올 수 https://angular-ui.github.io/bootstrap/#/modal이 문서를 확인하시기 바랍니다 모달위한 컨트롤러 이름을 제공해야

vm.viewGroupDetail = function(userDetails) { 

    var scope = $scope.$new(); 
    scope.userDetails = userDetails; 
    vm.userDetails=userDetails; 

    vm.modalInstance = $uibModal.open({ 
     animation: true, 
     templateUrl: 'app/views/groups/group_details_modal.html', 
     windowClass: 'd-modal', 
     size: 'lg', 
     scope: scope 

    }); 



}; 

모달 HTML :

<div class="modal-header portlet-title"> 
    <button type="button" class="close" aria-hidden="true" ng- click="$close()">&times;</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 vm.userDetails"> 
      <td> {{userdetail.fullName}}</td> 
      <td> {{userdetail.designation}} </td> 
      <td> <div class="user-img-holder"><img ng-src="{{userdetail.userdetail.fullName}}" alt="user Image"></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> 

내가 wr 그거야? -> 내 vm.userDetails가 정의되지 않았지만 HTML ng-repeat와 동일한 것을 사용하려고 시도했습니다.

그런 다음 동일한 scope.userDetails, value를 할당했습니다.

내가 조사한 바에 따르면, 내가 달성하고자하는 목표에 대해 실제로는 uibModal에서 해결할 필요가 없다.

여기까지입니다. 해결책을 찾았습니다. 제 문제를 해결해 주신 모든 분들께 감사드립니다. 이 답변이 도움이되기를 바랍니다.