From 209908637450e23afa40ec5a11f9b6fd236ca5ae Mon Sep 17 00:00:00 2001 From: Rupert Bedford Date: Thu, 26 May 2016 13:56:31 +0100 Subject: [PATCH] Add specialty column --- .../consultants-component.directive.js | 15 ++++++++++++--- src/app/consultants/consultants-component.html | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/app/consultants/consultants-component.directive.js b/src/app/consultants/consultants-component.directive.js index 1e0ade21..278989b6 100644 --- a/src/app/consultants/consultants-component.directive.js +++ b/src/app/consultants/consultants-component.directive.js @@ -12,7 +12,8 @@ ConsultantPermission, firstPromise, $injector, - store + store, + _ ) { function ConsultantsController($scope) { var self = this; @@ -24,7 +25,14 @@ } }); - self.load(store.findMany('consultants')); + self.load(firstPromise([ + store.findMany('consultants'), + store.findMany('specialties').then(function(specialties) { + $scope.specialties = _.sortBy(specialties, function(x) { + return x.name; + }); + }) + ])); $scope.create = function() { var item = store.create('consultants'); @@ -43,7 +51,8 @@ 'ConsultantPermission', 'firstPromise', '$injector', - 'store' + 'store', + '_' ]; app.factory('ConsultantsController', controllerFactory); diff --git a/src/app/consultants/consultants-component.html b/src/app/consultants/consultants-component.html index 2f2f90cd..80457bf4 100644 --- a/src/app/consultants/consultants-component.html +++ b/src/app/consultants/consultants-component.html @@ -16,6 +16,11 @@ {{item.lastName}} + + Specialty + {{item.specialty.name}} + + Email Address {{item.email | missing}} @@ -71,6 +76,15 @@ +
+
Specialty
+ +
+
+
+
+
+
Email
@@ -124,6 +138,7 @@ First Name Last Name + Specialty Email Telephone Number GMC Number @@ -141,6 +156,7 @@ {{item.firstName}} {{item.lastName}} + {{item.specialty.name}} {{item.email | missing}} {{item.telephoneNumber | missing}} {{item.gmcNumber | missing}}