diff --git a/app/views/api/tournaments.jbuilder b/app/views/api/tournaments.jbuilder index a0487e3..c9f6ee7 100644 --- a/app/views/api/tournaments.jbuilder +++ b/app/views/api/tournaments.jbuilder @@ -1,3 +1,3 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id, :name, :address, :director, :director_email + json.extract! tournament, :id, :name, :address, :director, :director_email, :date end \ No newline at end of file diff --git a/frontend/app/js/app.js b/frontend/app/js/app.js index 34d039c..899b26e 100644 --- a/frontend/app/js/app.js +++ b/frontend/app/js/app.js @@ -1,30 +1 @@ -function ctrl($scope){ - $scope.rows = ['Paul','John','Lucie']; - $scope.temp = false; - - $scope.addRow = function(){ - $scope.temp = false; - $scope.addName=""; - }; - - $scope.deleteRow = function(row){ - $scope.rows.splice($scope.rows.indexOf(row),1); - }; - - $scope.plural = function (tab){ - return tab.length > 1 ? 's': ''; - }; - - $scope.addTemp = function(){ - if($scope.temp) $scope.rows.pop(); - else if($scope.addName) $scope.temp = true; - - if($scope.addName) $scope.rows.push($scope.addName); - else $scope.temp = false; - }; - - $scope.isTemp = function(i){ - return i==$scope.rows.length-1 && $scope.temp; - }; - -} \ No newline at end of file +var app = angular.module("wrestlingdev", []); \ No newline at end of file diff --git a/frontend/app/js/homeController.js b/frontend/app/js/homeController.js new file mode 100644 index 0000000..4e261b4 --- /dev/null +++ b/frontend/app/js/homeController.js @@ -0,0 +1,17 @@ +app.controller("homeController", function($scope, $http) { + $scope.message = "Test message in scope."; + + + $http({ + method: 'GET', + url: '/api/tournaments/' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.query = response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.query = "Nothing there"; + }); +}); \ No newline at end of file diff --git a/frontend/app/pages/index.us b/frontend/app/pages/index.us index fdd4042..b380a2f 100644 --- a/frontend/app/pages/index.us +++ b/frontend/app/pages/index.us @@ -1,36 +1,85 @@ - -
- - - - - -| {{$index+1}} | -{{row}} | -- - | -