daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Nov 20th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <a href="" class="btn btn-info btn-block" ng-click="editarCliente(cliente)">
  2.    
  3. $scope.editarCliente = function($cliente) {
  4.  
  5.     $scope.clienteEdit = {
  6.         CliNome: $cliente.cli_nome,
  7.         CliTelefone: $cliente.cli_telefone,
  8.         CliEmail: $cliente.cli_email,
  9.         CliDescricao: $cliente.cli_descricao
  10.     };
  11.  
  12.      var modalInstance = $uibModal.open({
  13.       animation: $scope.animationsEnabled,
  14.       templateUrl: 'myModalContent.html',
  15.       controller: 'clienteController',
  16.       //size: size,
  17.       resolve: {
  18.         cliente: function () {
  19.           return $scope.clienteEdit;
  20.         }
  21.       }
  22.     });
  23.    
  24. <script type="text/ng-template" id="myModalContent.html">
  25. <div class="modal-header">
  26.     <h3 class="modal-title">Editar</h3>
  27. </div>
  28. <div class="modal-body">
  29.     <ul>
  30.         <li ng-repeat="item in items">
  31.             <a href="#" ng-click="$event.preventDefault(); selected.item = item">{{ item }}</a>
  32.         </li>
  33.     </ul>
  34.     Selected: <b>{{ clienteEdit.CliNome }}</b>
  35. </div>
  36. <div class="modal-footer">
  37.     <button class="btn btn-primary" type="button" ng-click="ok()">Salvar</button>
  38.     <button class="btn btn-warning" type="button" ng-click="cancel()">Fechar</button>
  39. </div>
  40.    
  41. .controller("ModalCtrl", function($scope, $modalInstance, cliente) {..}
  42.    
  43. $scope.cliente = cliente;
  44.    
  45. <div class="modal-body">
  46.    {{cliente .nome}}
  47. </div>
RAW Paste Data
Top