mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
LH :: Updated controllers to include pets and about page
This commit is contained in:
parent
e31c48d36f
commit
664e5459c3
7 changed files with 82 additions and 13 deletions
10
src/main/webapp/components/about/AboutController.js
Normal file
10
src/main/webapp/components/about/AboutController.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
var AboutController = function($scope, $rootScope, $sce, $timeout, $location,
|
||||
$route, $interval, $cookieStore, $window) {
|
||||
|
||||
$scope.$route = $route;
|
||||
$scope.$location = $location;
|
||||
};
|
||||
|
||||
var AboutControllerDeclaration = [ '$scope', '$rootScope', '$sce', '$timeout',
|
||||
'$location', '$route', '$interval', '$cookieStore', '$window',
|
||||
AboutController ];
|
1
src/main/webapp/components/about/about.html
Normal file
1
src/main/webapp/components/about/about.html
Normal file
|
@ -0,0 +1 @@
|
|||
<div>This is the about page</div>
|
|
@ -10,16 +10,16 @@ var MenuController = function($scope, $rootScope, $sce, $timeout, $location,
|
|||
'url' : '#services',
|
||||
'font' : 'fa fa-eyedropper'
|
||||
}, {
|
||||
'name' : 'Vets',
|
||||
'url' : '#vets',
|
||||
'name' : 'Pets',
|
||||
'url' : '#pets',
|
||||
'font' : 'fa fa-paw'
|
||||
}, {
|
||||
'name' : 'Veterinarians',
|
||||
'url' : '#veterinarians',
|
||||
'font' : 'fa fa-user'
|
||||
}, {
|
||||
'name' : 'Help',
|
||||
'url' : '#help',
|
||||
'name' : 'About',
|
||||
'url' : '#about',
|
||||
'font' : 'fa fa-question'
|
||||
} ];
|
||||
$scope.$route = $route;
|
||||
|
|
10
src/main/webapp/components/pets/PetController.js
Normal file
10
src/main/webapp/components/pets/PetController.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
var PetController = function($scope, $rootScope, $sce, $timeout, $location,
|
||||
$route, $interval, $cookieStore, $window) {
|
||||
|
||||
$scope.$route = $route;
|
||||
$scope.$location = $location;
|
||||
};
|
||||
|
||||
var PetControllerDeclaration = [ '$scope', '$rootScope', '$sce', '$timeout',
|
||||
'$location', '$route', '$interval', '$cookieStore', '$window',
|
||||
PetController ];
|
44
src/main/webapp/components/pets/pets.html
Normal file
44
src/main/webapp/components/pets/pets.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
<div id="tabContent" data-ng-controller="PetController">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<div class="box-name">
|
||||
<i class="fa fa-table"></i> <span>Pets</span>
|
||||
</div>
|
||||
<div class="box-icons">
|
||||
<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
|
||||
</a> <a class="expand-link"> <i class="fa fa-expand"></i>
|
||||
</a> <a class="close-link"> <i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="no-move"></div>
|
||||
</div>
|
||||
<div class="box-content no-padding">
|
||||
<table
|
||||
class="table table-striped table-bordered table-hover table-heading no-border-bottom">
|
||||
<tr>
|
||||
<th colspan="{{pets.length}}">Pet</th>
|
||||
</tr>
|
||||
<tr data-ng-repeat="pet in pets">
|
||||
<td><span data-ng-bind="pet.name"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group has-success">
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="form-control" placeholder="Search" data-toggle="tooltip" data-placement="bottom" title="Search" data-ng-model="searchText">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-label-left"
|
||||
data-ng-click="searchPets()">
|
||||
<span><i class="fa fa-clock-o"></i></span> Search
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" ng-app="xi-km">
|
||||
<html lang="en" data-ng-app="spring-petclinic">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Vet Clinic</title>
|
||||
|
@ -82,12 +82,12 @@
|
|||
</header>
|
||||
<!--End Header-->
|
||||
<!--Start Container-->
|
||||
<div id="main" class="container-fluid" ng-controller="MenuController">
|
||||
<div id="main" class="container-fluid" data-ng-controller="MenuController">
|
||||
<div class="row">
|
||||
<div id="sidebar-left" class="col-xs-2 col-sm-2">
|
||||
<ul class="nav main-menu">
|
||||
|
||||
<li class="dropdown" ng-repeat="tab in menuTabs">
|
||||
<li class="dropdown" data-ng-repeat="tab in menuTabs">
|
||||
<a href="{{tab.url}}" class="ajax-link">
|
||||
<i class="{{tab.font}}"></i>
|
||||
<span class="hidden-xs">{{tab.name}}</span>
|
||||
|
@ -103,7 +103,7 @@
|
|||
<pre>$routeParams = {{$routeParams}}</pre> -->
|
||||
<!--Start Content-->
|
||||
<div id="content" class="col-xs-12 col-sm-10">
|
||||
<div ng-view></div>
|
||||
<div data-ng-view></div>
|
||||
</div>
|
||||
<!--End Content-->
|
||||
</div>
|
||||
|
@ -130,6 +130,8 @@
|
|||
|
||||
<script src="components/menu/MenuController.js"></script>
|
||||
<script src="components/landing/LandingController.js"></script>
|
||||
<script src="components/about/AboutController.js"></script>
|
||||
<script src="components/pets/PetController.js"></script>
|
||||
<script src="components/veterinarians/VeterinarianController.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
var app = angular.module('xi-km', [ 'ui.bootstrap', 'ngRoute', 'ngCookies',
|
||||
var app = angular.module('spring-petclinic', [ 'ui.bootstrap', 'ngRoute', 'ngCookies',
|
||||
'ngAnimate', 'ngTagsInput', 'angularFileUpload' ]);
|
||||
|
||||
|
||||
app.controller('MenuController', MenuControllerDeclaration);
|
||||
app.controller('LandingController', LandingControllerDeclaration);
|
||||
app.controller('VeterinarianController', VeterinarianControllerDeclaration);
|
||||
|
@ -13,9 +12,12 @@ app.config([ '$routeProvider', function($routeProvider) {
|
|||
}).when('/veterinarians', {
|
||||
templateUrl : 'components/veterinarians/veterinarians.html',
|
||||
controller : 'VeterinarianController'
|
||||
}).when('/help', {
|
||||
templateUrl : 'components/help/help.html',
|
||||
controller : 'HelpController'
|
||||
}).when('/about', {
|
||||
templateUrl : 'components/about/about.html',
|
||||
controller : 'AboutController'
|
||||
}).when('/pets', {
|
||||
templateUrl : 'components/pets/pets.html',
|
||||
controller : 'PetController'
|
||||
}).otherwise({
|
||||
redirectTo : '/landing'
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue