3
Hello
By clicking on the link:
<a href="" class="btn btn-info btn-block" ng-click="editarCliente(cliente)">
opens a modal (bootstrap
) and shall display the data contained in cliente
.
I’m using angular ui
Follows the $scope
$scope.editarCliente = function($cliente) {
$scope.clienteEdit = {
CliNome: $cliente.cli_nome,
CliTelefone: $cliente.cli_telefone,
CliEmail: $cliente.cli_email,
CliDescricao: $cliente.cli_descricao
};
var modalInstance = $uibModal.open({
animation: $scope.animationsEnabled,
templateUrl: 'myModalContent.html',
controller: 'clienteController',
//size: size,
resolve: {
cliente: function () {
return $scope.clienteEdit;
}
}
});
Note: opens the modal without problems:
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header">
<h3 class="modal-title">Editar</h3>
</div>
<div class="modal-body">
<ul>
<li ng-repeat="item in items">
<a href="#" ng-click="$event.preventDefault(); selected.item = item">{{ item }}</a>
</li>
</ul>
Selected: <b>{{ clienteEdit.CliNome }}</b>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="ok()">Salvar</button>
<button class="btn btn-warning" type="button" ng-click="cancel()">Fechar</button>
</div>
But it doesn’t show the contents of $scope
clienteController
is theController
where its function is to edit?– DiegoAugusto
is in the
scope
...$scope.editarCliente
– novato
Yes, but this one
clienteController
is proper pro modal?– DiegoAugusto