Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('app').controller('MootController', ['$scope', '$http', '$rootScope', '$routeParams',
- function($scope, $http, $rootScope, $routeParams) {
- $scope.getTotalVotes = function(rullingId, voto_type) {
- $http({
- url: "/companies/" + $routeParams.companyId + "/moots/" + $routeParams.mootId + '/rullings/' + rullingId + '/totalvotes.json',
- method: "GET",
- params: {vote: voto_type}
- })
- .success(function(result) {
- if (result.total > 0) {
- $scope.totalVotes = result.total;
- } else {
- $scope.totalVotes = 0;
- }
- })
- .error(function(erro) {
- console.log(erro);
- });
- }
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement