Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var grid = document.getElementsByClassName('botao');
- function click(a, b, c) {
- for (var i = 0; i < grid.length; i++) {
- grid[i].className = 'botao';
- }
- a.target.className = 'botao vermelho';
- }
- for (var i = 0; i < grid.length; i++) {
- grid[i].addEventListener('click', click);
- }
- angular.module("meumodulo", [])
- .controller("indexController", function ($scope, $http) {
- $http.get("test.php")
- .then(function (response) {
- $scope.players = response.data;
- });
- var indexedTeams = [];
- // this will reset the list of indexed teams each time the list is rendered again
- $scope.playersToFilter = function () {
- indexedTeams = [];
- return $scope.players;
- }
- $scope.filterTeams = function (player) {
- var teamIsNew = indexedTeams.indexOf(player.idgrupo) == -1;
- if (teamIsNew) {
- indexedTeams.push(player.idgrupo);
- }
- return teamIsNew;
- }
- })
- $(document).ready(function () {
- $(".button-collapse").sideNav();
- $('select').material_select();
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement