Commit 4a2941dc by Carl Bergquist Committed by GitHub

Merge pull request #9981 from grafana/more-js-to-ts-migration

migrated four files from js to ts
parents b752cfee 015932fd
define([
'./inspect_ctrl',
'./json_editor_ctrl',
'./login_ctrl',
'./invited_ctrl',
'./signup_ctrl',
'./reset_password_ctrl',
'./error_ctrl',
], function () {});
import './inspect_ctrl';
import './json_editor_ctrl';
import './login_ctrl';
import './invited_ctrl';
import './signup_ctrl';
import './reset_password_ctrl';
import './error_ctrl';
define([
'angular',
'app/core/config',
'../core_module',
],
function (angular, config, coreModule) {
'use strict';
coreModule.default.controller('ErrorCtrl', function($scope, contextSrv, navModelSrv) {
$scope.navModel = navModelSrv.getNotFoundNav();
$scope.appSubUrl = config.appSubUrl;
var showSideMenu = contextSrv.sidemenu;
contextSrv.sidemenu = false;
$scope.$on('$destroy', function() {
contextSrv.sidemenu = showSideMenu;
});
});
});
import config from 'app/core/config';
import coreModule from '../core_module';
export class ErrorCtrl {
/** @ngInject */
constructor($scope, contextSrv, navModelSrv) {
$scope.navModel = navModelSrv.getNotFoundNav();
$scope.appSubUrl = config.appSubUrl;
var showSideMenu = contextSrv.sidemenu;
contextSrv.sidemenu = false;
$scope.$on('$destroy', function() {
contextSrv.sidemenu = showSideMenu;
});
}
}
coreModule.controller('ErrorCtrl', ErrorCtrl);
define([
'angular',
'../core_module',
],
function (angular, coreModule) {
'use strict';
coreModule.default.controller('JsonEditorCtrl', function($scope) {
$scope.json = angular.toJson($scope.object, true);
$scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
$scope.update = function () {
var newObject = angular.fromJson($scope.json);
$scope.updateHandler(newObject, $scope.object);
};
});
});
import angular from 'angular';
import coreModule from '../core_module';
export class JsonEditorCtrl {
/** @ngInject */
constructor($scope) {
$scope.json = angular.toJson($scope.object, true);
$scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
$scope.update = function () {
var newObject = angular.fromJson($scope.json);
$scope.updateHandler(newObject, $scope.object);
};
}
}
coreModule.controller('JsonEditorCtrl', JsonEditorCtrl);
define([ import coreModule from '../core_module';
'angular',
'../core_module', export class ResetPasswordCtrl {
],
function (angular, coreModule) { /** @ngInject */
'use strict'; constructor($scope, contextSrv, backendSrv, $location) {
coreModule.default.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) {
contextSrv.sidemenu = false; contextSrv.sidemenu = false;
$scope.formModel = {}; $scope.formModel = {};
$scope.mode = 'send'; $scope.mode = 'send';
...@@ -37,7 +35,7 @@ function (angular, coreModule) { ...@@ -37,7 +35,7 @@ function (angular, coreModule) {
$location.path('login'); $location.path('login');
}); });
}; };
}
}
}); coreModule.controller('ResetPasswordCtrl', ResetPasswordCtrl);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment