diff --git a/public/app/core/controllers/all.js b/public/app/core/controllers/all.js deleted file mode 100644 index 54631586c2f..00000000000 --- a/public/app/core/controllers/all.js +++ /dev/null @@ -1,9 +0,0 @@ -define([ - './inspect_ctrl', - './json_editor_ctrl', - './login_ctrl', - './invited_ctrl', - './signup_ctrl', - './reset_password_ctrl', - './error_ctrl', -], function () {}); diff --git a/public/app/core/controllers/all.ts b/public/app/core/controllers/all.ts new file mode 100644 index 00000000000..0dbcdf4cb28 --- /dev/null +++ b/public/app/core/controllers/all.ts @@ -0,0 +1,7 @@ +import './inspect_ctrl'; +import './json_editor_ctrl'; +import './login_ctrl'; +import './invited_ctrl'; +import './signup_ctrl'; +import './reset_password_ctrl'; +import './error_ctrl'; diff --git a/public/app/core/controllers/error_ctrl.js b/public/app/core/controllers/error_ctrl.ts similarity index 54% rename from public/app/core/controllers/error_ctrl.js rename to public/app/core/controllers/error_ctrl.ts index fd4081186be..fe894a69806 100644 --- a/public/app/core/controllers/error_ctrl.js +++ b/public/app/core/controllers/error_ctrl.ts @@ -1,13 +1,10 @@ -define([ - 'angular', - 'app/core/config', - '../core_module', -], -function (angular, config, coreModule) { - 'use strict'; +import config from 'app/core/config'; +import coreModule from '../core_module'; - coreModule.default.controller('ErrorCtrl', function($scope, contextSrv, navModelSrv) { +export class ErrorCtrl { + /** @ngInject */ + constructor($scope, contextSrv, navModelSrv) { $scope.navModel = navModelSrv.getNotFoundNav(); $scope.appSubUrl = config.appSubUrl; @@ -17,7 +14,7 @@ function (angular, config, coreModule) { $scope.$on('$destroy', function() { contextSrv.sidemenu = showSideMenu; }); + } +} - }); - -}); +coreModule.controller('ErrorCtrl', ErrorCtrl); diff --git a/public/app/core/controllers/json_editor_ctrl.js b/public/app/core/controllers/json_editor_ctrl.ts similarity index 58% rename from public/app/core/controllers/json_editor_ctrl.js rename to public/app/core/controllers/json_editor_ctrl.ts index 7d7d56fa96b..ba6d9abfd74 100644 --- a/public/app/core/controllers/json_editor_ctrl.js +++ b/public/app/core/controllers/json_editor_ctrl.ts @@ -1,12 +1,10 @@ -define([ - 'angular', - '../core_module', -], -function (angular, coreModule) { - 'use strict'; +import angular from 'angular'; +import coreModule from '../core_module'; - coreModule.default.controller('JsonEditorCtrl', function($scope) { +export class JsonEditorCtrl { + /** @ngInject */ + constructor($scope) { $scope.json = angular.toJson($scope.object, true); $scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor; @@ -14,7 +12,7 @@ function (angular, coreModule) { var newObject = angular.fromJson($scope.json); $scope.updateHandler(newObject, $scope.object); }; + } +} - }); - -}); +coreModule.controller('JsonEditorCtrl', JsonEditorCtrl); diff --git a/public/app/core/controllers/reset_password_ctrl.js b/public/app/core/controllers/reset_password_ctrl.ts similarity index 80% rename from public/app/core/controllers/reset_password_ctrl.js rename to public/app/core/controllers/reset_password_ctrl.ts index 4cf014d2482..524cfb7af64 100644 --- a/public/app/core/controllers/reset_password_ctrl.js +++ b/public/app/core/controllers/reset_password_ctrl.ts @@ -1,11 +1,9 @@ -define([ - 'angular', - '../core_module', -], -function (angular, coreModule) { - 'use strict'; +import coreModule from '../core_module'; - coreModule.default.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) { +export class ResetPasswordCtrl { + + /** @ngInject */ + constructor($scope, contextSrv, backendSrv, $location) { contextSrv.sidemenu = false; $scope.formModel = {}; $scope.mode = 'send'; @@ -37,7 +35,7 @@ function (angular, coreModule) { $location.path('login'); }); }; + } +} - }); - -}); +coreModule.controller('ResetPasswordCtrl', ResetPasswordCtrl);