mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +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'
|
||||
});
|
||||
}]);
|
||||
@@ -34,35 +34,8 @@
|
||||
<div class="col-md-2">
|
||||
<!--leftsidebar-->
|
||||
</div>
|
||||
<div class="col-md-8" style="padding-left: 2%;">
|
||||
<div class="container" ui-view="main" ng-controller="tournamentsController">
|
||||
<h2>Upcoming Tournaments</h2>
|
||||
<br>
|
||||
<form ng-submit="searchTournaments()">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search by name or date YYYY-MM-DD" ng-model="searchTerms">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit" id="submit">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<br>
|
||||
<table class="table">
|
||||
<thead class="font-spot-color">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="tournament in allTournaments">
|
||||
<td>{{ tournament.name }}</td>
|
||||
<td>{{ tournament.date }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!--content-->
|
||||
<div id="view" ng-view></div>
|
||||
<div class="col-md-2" >
|
||||
<!--rightsidebar-->
|
||||
</div>
|
||||
|
||||
29
frontend/app/templates/tournaments.html
Normal file
29
frontend/app/templates/tournaments.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="col-md-8" style="padding-left: 2%;">
|
||||
<div class="container" ui-view="main" ng-controller="tournamentsController">
|
||||
<h2>Upcoming Tournaments</h2>
|
||||
<br>
|
||||
<form ng-submit="searchTournaments()">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search by name or date YYYY-MM-DD" ng-model="searchTerms">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit" id="submit">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<br>
|
||||
<table class="table">
|
||||
<thead class="font-spot-color">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="tournament in allTournaments">
|
||||
<td>{{ tournament.name }}</td>
|
||||
<td>{{ tournament.date }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,7 +26,8 @@ module.exports = function(lineman) {
|
||||
apiProxy: {
|
||||
enabled: true,
|
||||
host: 'localhost',
|
||||
port: 8080
|
||||
port: 8080,
|
||||
prefix: 'api'
|
||||
},
|
||||
web: {
|
||||
port: 8081
|
||||
|
||||
Reference in New Issue
Block a user