Guest User

Untitled

a guest
Sep 4th, 2013
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. controller('ClientesCtrl', function($scope, $location){
  2.     // write Ctrl here
  3.  
  4.     function showDetails(e) {
  5.         e.preventDefault();
  6.  
  7.         var cliente = this.dataItem($(e.currentTarget).closest("tr"));
  8.  
  9.         $location.path("/cliente/" + cliente._id);
  10.         $scope.$apply();
  11.     }
  12.     ....(rest of controllers code)....
  13.  
  14.  
  15.  
  16. ------------------------------------------------------------------------------------------
  17.  
  18.  
  19.     $scope.guardar_cliente = function(){
  20.         $http({
  21.             method: 'POST', url: '/api/guardar_cliente',
  22.             data: {
  23.                 cliente: $scope.cliente
  24.             }
  25.         }).
  26.         success(function(data, status, headers, config){
  27.             $location.path("/clientes");
  28.         }).
  29.         error(function(data, status, headers, config){
  30.             console.log(data);
  31.         });
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment