Skip to content

Instantly share code, notes, and snippets.

@luanfonceca
Created May 25, 2015 18:06
Show Gist options
  • Save luanfonceca/b010c85f824d6c496f4d to your computer and use it in GitHub Desktop.
Save luanfonceca/b010c85f824d6c496f4d to your computer and use it in GitHub Desktop.
# Html do botão
<button ng-click="minhaFuncao(objeto.id)" class="btn btn-xs btn-default">
<i class="fa fa-user-times"></i>
{{ _("Minha Funcao") }}
</button>
# Código do angularjs
(function(angular) {
var app = angular.module('meuModulo', []);
app.controller('MeuController', ['$scope', '$http', function($scope, $http) {
$scope.minhaFuncao = function(id) {
$http.post('/minha/url', {id: id});
}
}]);
})(window.angular);
# Log do Headers do Network do inspect
General
Remote Address:127.0.0.1:8080
Request URL:http://localhost:8080/minha/url
Request Method:POST
Status Code:404 Not Found
Response Headers
Cache-Control:no-cache
Content-Length:15557
Content-Type:text/html; charset=utf-8
Date:Mon, 25 May 2015 18:01:11 GMT
Pragma:no-cache
Server:PasteWSGIServer/0.5 Python/2.6.6
Request Headers
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8,es;q=0.6,pt;q=0.4,gl;q=0.2
Cache-Control:no-cache
Connection:keep-alive
Content-Length:50
Content-Type:application/json;charset=UTF-8
Origin:http://localhost:8080
Pragma:no-cache
Referer:http://localhost:8080
Request Payload
{id: "1"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment