diff --git a/client/scripts/controllers/EBPSettingsController.js b/client/scripts/controllers/EBPSettingsController.js index dd3ae46b..e96f5f19 100644 --- a/client/scripts/controllers/EBPSettingsController.js +++ b/client/scripts/controllers/EBPSettingsController.js @@ -1,3 +1,17 @@ -require('../app').controller('EBPSettingsController', /* @ngInject */function ($q, $translate, user, ngToast, Raven, User) { +require('../app').controller('EBPSettingsController', /* @ngInject */function ($q, $stateParams, EBPSpecies) { + const $ctrl = this + $ctrl.selected = 'sources' + + if ($stateParams.settings) { + $ctrl.selected = $stateParams.settings + } + + $ctrl.requestSpecies = function () { + $q.resolve(EBPSpecies.query().$promise).then(function (species) { + $ctrl.species = species + }) + } + + $ctrl.requestSpecies() }) diff --git a/client/scripts/models/ebp_species.js b/client/scripts/models/ebp_species.js new file mode 100644 index 00000000..a978fe60 --- /dev/null +++ b/client/scripts/models/ebp_species.js @@ -0,0 +1,4 @@ +require('../app').factory('EBPSpecies', /* @ngInject */function ($resource, ENDPOINT_URL, localization) { + const EBPSpecies = $resource(ENDPOINT_URL + '/ebp-species') + return EBPSpecies +}) diff --git a/client/views/ebp.html b/client/views/ebp.html index a390300d..c4f910e1 100644 --- a/client/views/ebp.html +++ b/client/views/ebp.html @@ -37,9 +37,11 @@