mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-07 23:17:25 +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">
|
<div class="col-md-2">
|
||||||
<!--leftsidebar-->
|
<!--leftsidebar-->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8" style="padding-left: 2%;">
|
<!--content-->
|
||||||
<div class="container" ui-view="main" ng-controller="tournamentsController">
|
<div id="view" ng-view></div>
|
||||||
<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>
|
|
||||||
<div class="col-md-2" >
|
<div class="col-md-2" >
|
||||||
<!--rightsidebar-->
|
<!--rightsidebar-->
|
||||||
</div>
|
</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: {
|
apiProxy: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: 8080
|
port: 8080,
|
||||||
|
prefix: 'api'
|
||||||
},
|
},
|
||||||
web: {
|
web: {
|
||||||
port: 8081
|
port: 8081
|
||||||
|
|||||||
Reference in New Issue
Block a user