$scope.$routeParams = $routeParams;
$scope.$location = $location;
$scope.organizations = [];
- View.getArrayPromise('organizations?group=true;format=key_array').then(function(data) {
- $scope.organizations = data;
- $log.info('organizations promise ', $scope.organizations);
+ View.getPromise('organizations?group=true;format=key_array').then(function(data) {
+ if ( angular.isArray(data.rows) ) {
+ $scope.organizations = data.rows;
+ $log.info('organizations promise ', $scope.organizations);
+ } else {
+ $log.info('no rows in', data);
+ }
});
$scope.ValidStates = ValidStates();
ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter', 'ValidStates' ];
+
+function AuthorsCtrl($scope, $log, View ) {
+ $scope.message = 'Loading data...';
+ $scope.ready = false;
+ View.getPromise('authors?format=key_distinct').then(function(data) {
+ if ( angular.isArray(data.rows) ) {
+ $scope.data = data;
+ $scope.authors = $scope.data.rows;
+ $scope.ready = true;
+ $log.info('authors promise ', data);
+ } else {
+ $log.info('no rows in', data);
+ $scope.message = 'No rows found';
+ }
+ });
+}
+
+AuthorsCtrl.$inject = [ '$scope', '$log', 'View' ];
+
+