PageSourceSearch

https://www.alejandrosanz.com/modules/club/index/indexClubCtrl.js

js alejandrosanz.com collected 2026-10-02 07:16:57 UTC 1,009 bytes, 33 lines download raw bytes

1'use strict';
2angular.module('alejandrosanz').controller("IndexClubCtrl", ['$scope', 'Club', '$alert', '$state', '$document', '$rootScope', function($scope, Club, $alert, $state, $document, $rootScope) {
3  $scope.filters = {
4    q: "",
5    per_page: 15,
6    page: 0
7  };
8
9  $scope.indexClubs = function(page) {
10    if (!isNaN(page)) $scope.filters.page = page;
11    Club.query($scope.filters, function(res, header) {
12      $scope.clubs = res;
13
14      // get total items
15      $scope.totalItems = header()['x-total-count'];
16
17      //find favourited
18      var index = res.findIndex(function(n) {
19        return n.favourite;
20      });
21      var position = angular.element(document.getElementById('clubs'));
22      if (Object.keys(position).length > 0) $document.scrollToElement(position, 200, 1000);
23    }, $alert.showError);
24  };
25
26  $scope.indexClubs();
27
28  $scope.openClub = function(club) {
29    name = $rootScope.makeUriFriendly(club.name);
30    $state.go('app.showClubs', { id: club.id, name: name });
31  };
32
33}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.