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:
@@ -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
30
frontend/app/js/routes.js
Normal 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'
|
||||
});
|
||||
}]);
|
||||
Reference in New Issue
Block a user