mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-14 00:49:54 +00:00
Created basic viewing pages in angular
Can now search and view tournaments. Can now view team scores, weights and seeds, mats and bout board
This commit is contained in:
12
frontend/app/js/controllers/tournament-controller.js
Normal file
12
frontend/app/js/controllers/tournament-controller.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
app.controller("tournamentController", function($scope, tournamentsService, $routeParams) {
|
||||
$scope.message = "Test message in scope.";
|
||||
|
||||
// $scope.tournamentData = "test";
|
||||
tournamentsService.tournamentDetails($routeParams.id).then(function(data) {
|
||||
//this will execute when the
|
||||
//AJAX call completes.
|
||||
$scope.tournament = data;
|
||||
});
|
||||
|
||||
});
|
||||
19
frontend/app/js/controllers/tournaments-controller.js
Normal file
19
frontend/app/js/controllers/tournaments-controller.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
app.controller("tournamentsController", function($scope, tournamentsService) {
|
||||
|
||||
tournamentsService.getAllTournaments().then(function(data) {
|
||||
//this will execute when the
|
||||
//AJAX call completes.
|
||||
$scope.allTournaments = data;
|
||||
});
|
||||
|
||||
$scope.searchTournaments = function (){
|
||||
tournamentsService.searchTournaments($scope.searchTerms).then(function(data) {
|
||||
//this will execute when the
|
||||
//AJAX call completes.
|
||||
$scope.allTournaments = data;
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user