فهرست منبع

migrated four files from js to ts

Patrick O'Carroll 8 سال پیش
والد
کامیت
015932fd02

+ 0 - 9
public/app/core/controllers/all.js

@@ -1,9 +0,0 @@
-define([
-  './inspect_ctrl',
-  './json_editor_ctrl',
-  './login_ctrl',
-  './invited_ctrl',
-  './signup_ctrl',
-  './reset_password_ctrl',
-  './error_ctrl',
-], function () {});

+ 7 - 0
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';

+ 8 - 11
public/app/core/controllers/error_ctrl.js → 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.navModel = navModelSrv.getNotFoundNav();
     $scope.appSubUrl = config.appSubUrl;
     $scope.appSubUrl = config.appSubUrl;
 
 
@@ -17,7 +14,7 @@ function (angular, config, coreModule) {
     $scope.$on('$destroy', function() {
     $scope.$on('$destroy', function() {
       contextSrv.sidemenu = showSideMenu;
       contextSrv.sidemenu = showSideMenu;
     });
     });
+  }
+}
 
 
-  });
-
-});
+coreModule.controller('ErrorCtrl', ErrorCtrl);

+ 8 - 10
public/app/core/controllers/json_editor_ctrl.js → 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.json = angular.toJson($scope.object, true);
     $scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
     $scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
 
 
@@ -14,7 +12,7 @@ function (angular, coreModule) {
       var newObject = angular.fromJson($scope.json);
       var newObject = angular.fromJson($scope.json);
       $scope.updateHandler(newObject, $scope.object);
       $scope.updateHandler(newObject, $scope.object);
     };
     };
+  }
+}
 
 
-  });
-
-});
+coreModule.controller('JsonEditorCtrl', JsonEditorCtrl);

+ 9 - 11
public/app/core/controllers/reset_password_ctrl.js → public/app/core/controllers/reset_password_ctrl.ts

@@ -1,11 +1,9 @@
-define([
-  'angular',
-  '../core_module',
-],
-function (angular, coreModule) {
-  'use strict';
-
-  coreModule.default.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) {
+import coreModule from '../core_module';
+
+export class ResetPasswordCtrl {
+
+  /** @ngInject */
+  constructor($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) {
         $location.path('login');
         $location.path('login');
       });
       });
     };
     };
+  }
+}
 
 
-  });
-
-});
+coreModule.controller('ResetPasswordCtrl', ResetPasswordCtrl);