mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-15 09:27:03 +00:00
Made login form look better and made user
menu look better.
This commit is contained in:
11
frontend/app/js/controllers/my-tournaments.js
Normal file
11
frontend/app/js/controllers/my-tournaments.js
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
app.controller("myTournamentsController", function($scope, tournamentsService, $rootScope) {
|
||||
|
||||
tournamentsService.getMyTournaments().then(function(data) {
|
||||
//this will execute when the
|
||||
//AJAX call completes.
|
||||
$scope.allTournaments = data;
|
||||
});
|
||||
|
||||
});
|
||||
@@ -24,6 +24,11 @@ app.config(['$routeProvider', '$locationProvider', function($routeProvider,$loca
|
||||
controller: 'tournamentsController'
|
||||
});
|
||||
|
||||
$routeProvider.when('/tournaments/user', {
|
||||
templateUrl: 'my-tournaments.html',
|
||||
controller: 'myTournamentsController'
|
||||
});
|
||||
|
||||
$routeProvider.when('/tournaments/:id', {
|
||||
templateUrl: 'tournaments-show.html',
|
||||
controller: 'tournamentController'
|
||||
|
||||
@@ -4,7 +4,12 @@ app.factory('tournamentsService', tournamentsService);
|
||||
function tournamentsService($http){
|
||||
var service = {};
|
||||
|
||||
|
||||
service.getMyTournaments = function(user){
|
||||
return $http({
|
||||
url: '/api/tournaments/user/',
|
||||
method: "GET"
|
||||
}).then(successResponse, errorCallback);
|
||||
};
|
||||
|
||||
service.getAllTournaments = function(){
|
||||
return $http({
|
||||
|
||||
Reference in New Issue
Block a user