generate RegistrationState buttons from service data
[angular-drzb] / app / js / controllers.js
index 012415d..977758c 100644 (file)
@@ -11,7 +11,7 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
                $scope.organizations = data;
                $log.info('organizations promise ', $scope.organizations);
        });
-       $scope.RegistrationState = RegistrationState;
+       $scope.RegistrationState = RegistrationState();
 
        $scope.info = { message: '', css_class: '' } ; // alert box
 
@@ -161,7 +161,7 @@ function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
 }
 RegistrationCtrl.$inject = [ '$scope', '$log', 'Registration', '$routeParams', '$location', '$route', 'Organizations', 'RegistrationState' ];
 
-function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter) {
+function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, RegistrationState ) {
 
        $scope.list = [];
        $scope.list_results = 0;
@@ -181,6 +181,7 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter) {
                states: true,
                pager_numeric: false
        };
+       $scope.RegistrationState = RegistrationState();
 
        $scope.create_counts = function( array ) {
                $log.info('create_counts', array.length );
@@ -270,5 +271,5 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter) {
        }
 }
 
+ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter', 'RegistrationState' ];
 
-ListCtrl.$inject = [ '$scope', '$log', 'Registration', 'RegistrationTypes', '$filter' ];