diff --git a/src/main/webapp/js/app.js b/src/main/webapp/js/app.js
index 95e009a3a..c86da5044 100644
--- a/src/main/webapp/js/app.js
+++ b/src/main/webapp/js/app.js
@@ -2,7 +2,7 @@ var app = angular.module('spring-petclinic', ['ui.router','ui.router.stateHelper
/** Start of Configurable constants **/
-app.constant('useMockData', false);
+app.constant('useMockData', true);
app.constant('context', '/petclinic');
/** End of Configurable constants **/
@@ -42,6 +42,12 @@ app.config(['stateHelperProvider','$urlRouterProvider','$urlMatcherFactoryProvid
templateUrl: "components/owners/owners.html",
controller: "OwnerController",
data: { requireLogin : true }
+ }).state({
+ name: "ownerDetails",
+ url: "/owners/:id",
+ templateUrl: "components/owners/owner_details.html",
+ controller: "OwnerDetailsController",
+ data: {requireLogin : true}
});
} ]);
@@ -52,6 +58,7 @@ app.controller('DashboardController', DashboardController);
app.controller('VeterinarianController', VeterinarianController);
app.controller('PetController', PetController);
app.controller('OwnerController', OwnerController);
+app.controller('OwnerDetailsController', OwnerDetailsController);
app.controller('VisitController', VisitController);
/** Services **/
diff --git a/src/main/webapp/services/services.js b/src/main/webapp/services/services.js
index 776f63fea..95421e4ac 100644
--- a/src/main/webapp/services/services.js
+++ b/src/main/webapp/services/services.js
@@ -30,7 +30,8 @@ var MockService = ['$httpBackend', '$http', '$q', 'context', function($httpBacke
$q.all([
$http.get(context + '/static/mock-data/pets.json'),
$http.get(context + '/static/mock-data/vets.json'),
- $http.get(context + '/static/mock-data/owners.json')
+ $http.get(context + '/static/mock-data/owners.json'),
+ $http.get(context + '/static/mock-data/owner_one.json')
]).then(function(data) {
console.log("Mocking /api/pets");
$httpBackend.whenGET(context + '/api/pets').respond(data[0].data);
@@ -38,6 +39,8 @@ var MockService = ['$httpBackend', '$http', '$q', 'context', function($httpBacke
$httpBackend.whenGET(context + '/api/vets').respond(data[1].data);
console.log("Mocking /api/owners");
$httpBackend.whenGET(context + '/api/owners').respond(data[2].data);
+ console.log("Mocking /api/owners/1");
+ $httpBackend.whenGET(context + '/api/owners/1').respond(data[3].data);
console.log("Setting up passthrough for other urls");
var passThroughRegex = new RegExp('/');
diff --git a/src/main/webapp/static/mock-data/owner_one.json b/src/main/webapp/static/mock-data/owner_one.json
new file mode 100644
index 000000000..e40fa54b2
--- /dev/null
+++ b/src/main/webapp/static/mock-data/owner_one.json
@@ -0,0 +1,22 @@
+{
+ "id" : 1,
+ "firstName" : "George",
+ "lastName" : "Franklin",
+ "description" : null,
+ "address" : "110 W. Liberty St.",
+ "city" : "Madison",
+ "telephone" : "6085551023",
+ "pets" : [ {
+ "id" : 1,
+ "name" : "Leo",
+ "birthDate" : "2010-09-07T00:00:00.000Z",
+ "type" : {
+ "id" : 1,
+ "name" : "cat",
+ "new" : false
+ },
+ "visits" : [ ],
+ "new" : false
+ } ],
+ "new" : false
+}
\ No newline at end of file