mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-12 16:25:41 +00:00
Moved api call to a service
This commit is contained in:
10
frontend/app/js/tournaments-controller.js
Normal file
10
frontend/app/js/tournaments-controller.js
Normal file
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user