Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- controller('ClientesCtrl', function($scope, $location){
- // write Ctrl here
- function showDetails(e) {
- e.preventDefault();
- var cliente = this.dataItem($(e.currentTarget).closest("tr"));
- $location.path("/cliente/" + cliente._id);
- $scope.$apply();
- }
- ....(rest of controllers code)....
- ------------------------------------------------------------------------------------------
- $scope.guardar_cliente = function(){
- $http({
- method: 'POST', url: '/api/guardar_cliente',
- data: {
- cliente: $scope.cliente
- }
- }).
- success(function(data, status, headers, config){
- $location.path("/clientes");
- }).
- error(function(data, status, headers, config){
- console.log(data);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment