1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 22:21:26 +00:00

Trying to get routes working but they are not working at the moment. Also moved the tournaments search and table to its own page

This commit is contained in:
2016-03-22 11:29:32 +00:00
parent 97ec2971a5
commit 2c44bc9845
5 changed files with 73 additions and 31 deletions

View File

@@ -1 +1,10 @@
var app = angular.module("wrestlingdev", []);
var app = angular.module("wrestlingdev", ["ngRoute"]).run(function($rootScope) {
// adds some basic utilities to the $rootScope for debugging purposes
$rootScope.log = function(thing) {
console.log(thing);
};
$rootScope.alert = function(thing) {
alert(thing);
};
});

30
frontend/app/js/routes.js Normal file
View File

@@ -0,0 +1,30 @@
// $routeProvider.when('/list-of-books', {
// templateUrl: 'angular/books.html',
// controller: 'BooksController'
// // uncomment if you want to see an example of a route that resolves a request prior to rendering
// // resolve: {
// // books : function(BookService) {
// // return BookService.get();
// // }
// // }
// });
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/tournaments', {
templateUrl: 'tournaments.html',
controller: 'tournamentsController'
}).
// when('/phones/:phoneId', {
// templateUrl: 'partials/phone-detail.html',
// controller: 'PhoneDetailCtrl'
// }).
otherwise({
redirectTo: '/tournaments'
});
}]);