function openCreateGroupModal() {
              var modalInstance = $uibModal.open({
                  animation: true,
                  ariaLabelledBy: 'modal-title',
                  ariaDescribedBy: 'modal-body',
                  templateUrl: 'js/app/consumers/groups/create-group-modal.html',
                  controller: ['$scope','$rootScope','$uibModalInstance','KongGroupModel',
                      function($scope,$rootScope, $uibModalInstance,KongGroupModel){

                          $scope.close = close
                          $scope.createGroup = createGroup
                          $scope.group = {
                              name : '',
                          }



                          function createGroup() {
                              KongGroupModel
                                  .create(angular.copy($scope.group))
                                  .then(
                                      function onSuccess(result) {
                                          if(result.data && result.data.error){
                                              $scope.errors = {}
                                              for(var key in result.data.invalidAttributes){
                                                  $scope.errors[key] = result.data.invalidAttributes[key][0].message
                                              }
                                          }else{
                                              MessageService.success('New group created successfully');
                                              $rootScope.$broadcast('kong.group.created',result)
                                              close()
                                          }

                                      },
                                      function onError(err) {

                                          $log.error(err);
                                          $scope.errors = err.data.body || err.data.customMessage || {}
                                      }
                                  )
                          }

                          function close() {
                              $uibModalInstance.dismiss()
                          }
                  }],
                  controllerAs: '$ctrl',
              });

              modalInstance.result.then(function (selectedItem) {

              }, function () {

              });
          }
This file contains all necessary Angular controller definitions for 'frontend.examples.author' module.

Note that this file should only contain controllers and nothing else.