mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
21 lines
661 B
JavaScript
21 lines
661 B
JavaScript
app.controller("tournamentsController", function($scope, tournamentsService) {
|
|
$scope.message = "Test message in scope.";
|
|
|
|
tournamentsService.getAllTournaments().then(function(data) {
|
|
//this will execute when the
|
|
//AJAX call completes.
|
|
console.log(data);
|
|
$scope.allTournaments = data;
|
|
});
|
|
|
|
$scope.searchTournaments = function (){
|
|
console.log("Tried search");
|
|
tournamentsService.searchTournaments($scope.searchTerms).then(function(data) {
|
|
//this will execute when the
|
|
//AJAX call completes.
|
|
console.log(data);
|
|
$scope.allTournaments = data;
|
|
});
|
|
}
|
|
|
|
}); |