{"size": 1259, "ext": "js", "max_stars_repo_path": "app/assets/js/controllers/PollController.js", "max_stars_repo_name": "dlasrado/pollgoat", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/assets/js/controllers/PollController.js", "max_issues_repo_name": "dlasrado/pollgoat", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/assets/js/controllers/PollController.js", "max_forks_repo_name": "dlasrado/pollgoat", "max_forks_repo_forks_event_min_datetime": "2021-12-10T06:28:20.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-10T06:28:20.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 29.9761904762, "max_line_length": 76, "alphanum_fraction": 0.5988880064}

  var PollController = (function() {

    function PollController($log, PollService) {
      this.$log = $log;
      this.PollService = PollService;
      this.$log.debug("constructing PollController");
      this.polls = [];
      this.adpolls = [];
      this.getTop10Polls();
      this.getAdPolls();
    }

    PollController.prototype.getTop10Polls = function() {
      var _this = this;
      this.$log.debug("getTop10Polls()");
      return this.PollService.listTop10Polls().then(function(data) {
        _this.$log.debug("Promise returned " + data.length + " Polls");
        return _this.polls = data;
      }, function(error) {
        return _this.$log.error("Unable to get polls: " + error);
      });
    };
    
    PollController.prototype.getAdPolls = function() {
        var _this = this;
        this.$log.debug("getAdPolls()");
        return this.PollService.listAdPolls().then(function(data) {
          _this.$log.debug("Promise returned " + data.length + " ad Polls");
          return _this.adpolls = data;
        }, function(error) {
          return _this.$log.error("Unable to get ad polls: " + error);
        });
      };

    return PollController;

  })();

  controllersModule.controller('PollController', PollController);

