0

I´m trying to get variables from modal to an other modal, this is mi modal:

   <div id="contentModal" class="modal fade" >
        <div class="modal-content animate" tabindex="-1">
            <div class="modal-container-">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h1>Issue:  {{selected_issue.Issue}}</h1>
              </div>
                <div class="modal-body row">
                    <div class="col-md-5">
                        <h5 style="text-align: center;">Descripción</h5>                   
                        <p1>{{selected_issue.Descripcion}}</p1>
                      </div> 
                      <div class="col-md-5">
                        <h5 style="text-align: center;">Solución</h5>
                       <p1>{{selected_issue.Solucion}}</p1>
                      </div>


                    <div id="modalSpec"class="col-md-2">
                        <h6>OpCo:</h6>
                        <p1>{{selected_issue.opCo}}</p1>
                        <h6>Tecnologia:</h6>
                        <p1>{{selected_issue.Tecnology}}</p1>
                        <h6>Version:</h6>
                        <p1>{{selected_issue.Version}}</p1>
                        <h6>Estado:</h6>
                        <p1>{{selected_issue.Status}}</p1>
                        <h6>Autor:</h6>
                        <p1>{{selected_issue.Autor}}</p1>
                        <p1>{{id}}</p1>
                        <div>
                          <h6>Editar:</h6>
                          <select name='type' id='type'>
                          <option value="" disabled selected>Seleccionar</option>
                          <option value='OpCo' >Descripción</option>
                          <option value='Solucion' >Solución</option>
                          <option value='Estado' >Estado</option>
                          </select>
                          <div><button id"modalClose" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button></div>  
                        </div>
                  </div>
                </div>
            </div>

     </div>
              <script>
  $("#type").on("change", function () {        
      $modal = $('#secondModal');
      if($(this).val() === 'OpCo'){
        $modal.modal('show');
        $('#type').val('');
    }
 });
  </script>
  </div>

As the code shows, the script that triggers the second modal is inside the first modal.Whenever you select something from the dropdown menu, modal pops-up, but i do not know how to pass variables like for example {{selected_issue.Descripcion}}, also i would like to know how to pass the $index value from the array.

Thanks a lot to everyone.

Marcelo
  • 784
  • 3
  • 9
  • 30
  • I would use $uibModal service if you are using angularjs https://stackoverflow.com/questions/35350463/angular-uibmodal-resolve-unknown-provider – Praveen Aug 17 '17 at 21:09
  • try avoid using jquery on angular apps. better use like @Praveen says ui-bootstrap has modal service. – Jesus Carrasco Aug 17 '17 at 21:22
  • Pretty difficult to understand how to use this uibModal service...could you explain a little bit further applying to my case? @Praveen – Marcelo Aug 18 '17 at 12:06

1 Answers1

0

$uibModal is a service to create modal windows. Creating modals is straightforward: create a template and controller, and reference them when using $uibModal. The $uibModal service has only one method: open(options).

Refer to 'open multiple modals at once' button in the Plunker

For more info refer this link

Now, in your case try pasting your markup code and use resolve object which is in open() or openComponentModal().

Praveen
  • 347
  • 1
  • 3
  • 20