Skip to content

Commit

Permalink
chore(angularjs): Remove all 'ngInject'; in favor of explicit DI anno…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
christopherthielen committed Feb 21, 2019
1 parent b6bab1e commit cc52bee
Show file tree
Hide file tree
Showing 184 changed files with 84 additions and 384 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface IAmazonMultiInstanceJob extends IMultiInstanceJob {
export class AmazonInstanceWriter extends InstanceWriter {
public static $inject = ['providerServiceDelegate'];
public constructor(protected providerServiceDelegate: ProviderServiceDelegate) {
'ngInject';
super(providerServiceDelegate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class AwsLoadBalancerDetailsController implements IController {
private securityGroupReader: SecurityGroupReader,
private loadBalancerReader: LoadBalancerReader,
) {
'ngInject';
this.application = app;
this.loadBalancerFromParams = loadBalancer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class AwsTargetGroupDetailsController implements IController {
targetGroup: ITargetGroupFromStateParams,
private app: Application,
) {
'ngInject';
this.application = app;
this.targetGroupFromParams = targetGroup;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export class AwsServerGroupConfigurationService {
private cacheInitializer: CacheInitializerService,
private loadBalancerReader: LoadBalancerReader,
private serverGroupCommandRegistry: ServerGroupCommandRegistry,
) {
'ngInject';
}
) {}

public configureUpdateCommand(command: IAmazonServerGroupCommand): void {
command.backingData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class TargetTrackingSummaryController implements IComponentController {
public popoverTemplate = require('./targetTrackingPopover.html');

public static $inject = ['$uibModal', 'confirmationModalService'];
constructor(private $uibModal: IModalService, private confirmationModalService: ConfirmationModalService) {
'ngInject';
}
constructor(private $uibModal: IModalService, private confirmationModalService: ConfirmationModalService) {}

public $onInit() {
this.config = this.policy.targetTrackingConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export class UpsertTargetTrackingController implements IComponentController {
public policy: ITargetTrackingPolicy,
public serverGroup: IServerGroup,
public application: Application,
) {
'ngInject';
}
) {}

public $onInit() {
const metricType = this.policy.targetTrackingConfiguration.customizedMetricSpecification ? 'custom' : 'predefined';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class AppengineCacheConfigurer {
};

public static $inject = ['loadBalancerReader'];
constructor(private loadBalancerReader: any) {
'ngInject';
}
constructor(private loadBalancerReader: any) {}
}

export const APPENGINE_CACHE_CONFIGURER = 'spinnaker.appengine.cacheConfigurer.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class AppengineConditionalDescriptionListItemCtrl implements IController {
public component: any;

public static $inject = ['$filter'];
constructor(private $filter: IFilterService) {
'ngInject';
}
constructor(private $filter: IFilterService) {}

public $onInit(): void {
if (!this.label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class AppengineInstanceDetailsController implements IController {
private confirmationModalService: ConfirmationModalService,
instance: InstanceFromStateParams,
) {
'ngInject';

this.app
.ready()
.then(() => this.retrieveInstance(instance))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class AppengineLoadBalancerWizardController implements IController {
private appengineLoadBalancerTransformer: AppengineLoadBalancerTransformer,
private wizardSubFormValidation: any,
) {
'ngInject';
this.submitButtonLabel = this.forPipelineConfig ? 'Done' : 'Update';

if (this.isNew) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class AppengineLoadBalancerDetailsController implements IController {
private app: Application,
private confirmationModalService: ConfirmationModalService,
) {
'ngInject';
this.loadBalancerFromParams = loadBalancer;
this.app
.getDataSource('loadBalancers')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ export class AppengineLoadBalancerUpsertDescription implements ILoadBalancerUpse

export class AppengineLoadBalancerTransformer {
public static $inject = ['$q'];
constructor(private $q: ng.IQService) {
'ngInject';
}
constructor(private $q: ng.IQService) {}

public normalizeLoadBalancer(loadBalancer: ILoadBalancer): ng.IPromise<ILoadBalancer> {
loadBalancer.provider = loadBalancer.type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { AppengineStageCtrl } from '../appengineStage.controller';
class AppengineDestroyAsgStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(protected $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppengineStageCtrl } from '../appengineStage.controller';
class AppengineDisableAsgStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(protected $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { APPENGINE_LOAD_BALANCER_CHOICE_MODAL_CTRL } from './loadBalancerChoice.
class AppengineEditLoadBalancerStageCtrl implements IController {
public static $inject = ['$scope', '$uibModal'];
constructor(public $scope: any, private $uibModal: IModalService) {
'ngInject';
$scope.stage.loadBalancers = $scope.stage.loadBalancers || [];
$scope.stage.cloudProvider = 'appengine';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class AppengineLoadBalancerChoiceModalCtrl implements IController {
private $uibModalInstance: IModalServiceInstance,
private application: Application,
) {
'ngInject';
this.initialize();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppengineStageCtrl } from '../appengineStage.controller';
class AppengineEnableAsgStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(protected $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface IAppengineShrinkClusterStage extends IAppengineStage {
class AppengineShrinkClusterStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(public $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppengineStageCtrl } from '../appengineStage.controller';
class AppengineStartServerGroupStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(public $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppengineStageCtrl } from '../appengineStage.controller';
class AppengineStopServerGroupStageCtrl extends AppengineStageCtrl {
public static $inject = ['$scope'];
constructor(public $scope: IAppengineStageScope) {
'ngInject';
super($scope);

super.setAccounts().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ export class AppengineServerGroupCommandBuilder {
}

public static $inject = ['$q'];
constructor(private $q: IQService) {
'ngInject';
}
constructor(private $q: IQService) {}

public buildNewServerGroupCommand(
app: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class AppengineServerGroupBasicSettingsCtrl implements IController {
$controller: IControllerService,
$uibModalStack: any,
) {
'ngInject';

extend(
this,
$controller('BasicSettingsMixin', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class AppengineCloneServerGroupCtrl implements IController {
private serverGroupWriter: ServerGroupWriter,
appengineServerGroupCommandBuilder: AppengineServerGroupCommandBuilder,
) {
'ngInject';
if (['create', 'clone', 'editPipeline'].includes(get<string>(serverGroupCommand, 'viewState.mode'))) {
this.$scope.command = serverGroupCommand;
this.state.loading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ class AppengineServerGroupDetailsController implements IController {
private appengineServerGroupWriter: AppengineServerGroupWriter,
private appengineServerGroupCommandBuilder: AppengineServerGroupCommandBuilder,
) {
'ngInject';

this.app
.ready()
.then(() => this.extractServerGroup(serverGroup))
Expand Down
4 changes: 1 addition & 3 deletions app/scripts/modules/appengine/src/serverGroup/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export class AppengineDeployDescription {

class AppengineServerGroupTransformer {
public static $inject = ['$q'];
constructor(private $q: ng.IQService) {
'ngInject';
}
constructor(private $q: ng.IQService) {}

public normalizeServerGroup(serverGroup: IServerGroup): ng.IPromise<IServerGroup> {
return this.$q.resolve(serverGroup);
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/modules/canary/canary/canaryStage.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ module.exports = angular
'serverGroupCommandBuilder',
'awsServerGroupTransformer',
function($scope, $uibModal, stage, providerSelectionService, serverGroupCommandBuilder, awsServerGroupTransformer) {
'ngInject';

$scope.isExpression = function(value) {
return isString(value) && value.includes('${');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class CloudFoundryInstanceDetailsCtrl implements IController {
private confirmationModalService: ConfirmationModalService,
private $q: IQService,
) {
'ngInject';
this.$scope.application = this.app;
this.$scope.instanceWriter = this.instanceWriter;
this.$scope.confirmationModalService = this.confirmationModalService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class CloudFoundryLoadBalancerDetailsCtrl implements IController {
loadBalancer: ILoadBalancerFromStateParams,
private $q: IQService,
) {
'ngInject';
this.$scope.application = this.app;
this.$scope.confirmationModalService = this.confirmationModalService;
this.$scope.loading = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ export class CloudFoundryLoadBalancerUpsertDescription

export class CloudFoundryLoadBalancerTransformer {
public static $inject = ['$q'];
constructor(private $q: ng.IQService) {
'ngInject';
}
constructor(private $q: ng.IQService) {}

public normalizeLoadBalancer(loadBalancer: ILoadBalancer): ng.IPromise<ILoadBalancer> {
loadBalancer.provider = loadBalancer.type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { IStage, Registry } from '@spinnaker/core';

class CloudfoundryCloneServerGroupStageCtrl implements IController {
public static $inject = ['$scope'];
constructor(public $scope: IScope) {
'ngInject';
}
constructor(public $scope: IScope) {}
}

export const CLOUD_FOUNDRY_CLONE_SERVER_GROUP_STAGE = 'spinnaker.cloudfoundry.pipeline.stage.cloneServerGroupStage';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { IServiceFieldValidatorConfig } from 'cloudfoundry/pipeline/config/valid

class CloudFoundryDeployServiceStageCtrl implements IController {
public static $inject = ['$scope'];
constructor(public $scope: IScope) {
'ngInject';
}
constructor(public $scope: IScope) {}
}

const serviceInstanceNameValidatorConfig: IServiceFieldValidatorConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Application, IStage, Registry } from '@spinnaker/core';
class CloudFoundryDestroyAsgStageCtrl implements IController {
public static $inject = ['$scope', 'application'];
constructor(public $scope: IScope, private application: Application) {
'ngInject';
this.$scope.application = this.application;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { CloudfoundryDestroyServiceExecutionDetails } from './CloudfoundryDestro

class CloudFoundryDestroyServiceStageCtrl implements IController {
public static $inject = ['$scope'];
constructor(public $scope: IScope) {
'ngInject';
}
constructor(public $scope: IScope) {}
}

export const CLOUD_FOUNDRY_DESTROY_SERVICE_STAGE = 'spinnaker.cloudfoundry.pipeline.stage.deleteServiceStage';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Application, IStage, Registry } from '@spinnaker/core';
class CloudFoundryDisableAsgStageCtrl implements IController {
public static $inject = ['$scope', 'application'];
constructor(public $scope: IScope, private application: Application) {
'ngInject';
this.$scope.application = this.application;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Application, IStage, Registry } from '@spinnaker/core';
class CloudFoundryEnableAsgStageCtrl implements IController {
public static $inject = ['$scope', 'application'];
constructor(public $scope: IScope, private application: Application) {
'ngInject';
this.$scope.application = this.application;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { CloudfoundryMapLoadBalancersExecutionDetails } from './CloudfoundryMapL
class CloudFoundryMapLoadBalancersStageCtrl implements IController {
public static $inject = ['$scope'];
constructor(public $scope: IScope) {
'ngInject';
$scope.accounts = [];
AccountService.listAccounts('cloudfoundry').then(accounts => {
$scope.accounts = accounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IInstanceFieldSizeValidationConfig } from 'cloudfoundry/pipeline/config
class CloudFoundryResizeAsgStageCtrl implements IController {
public static $inject = ['$scope', 'application'];
constructor(public $scope: IScope, private application: Application) {
'ngInject';
this.$scope.application = this.application;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Application, IStage, Registry } from '@spinnaker/core';
class CloudFoundryRollbackClusterStageCtrl implements IController {
public static $inject = ['$scope', 'application'];
constructor(public $scope: IScope, private application: Application) {
'ngInject';
this.$scope.application = this.application;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { CloudfoundryUnmapLoadBalancersExecutionDetails } from './CloudfoundryUn
class CloudFoundryUnmapLoadBalancersStageCtrl implements IController {
public static $inject = ['$scope'];
constructor(public $scope: IScope) {
'ngInject';
$scope.accounts = [];
AccountService.listAccounts('cloudfoundry').then(accounts => {
$scope.accounts = accounts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export class CloudFoundryServerGroupCommandBuilder {
}

public static $inject = ['$q'];
constructor(private $q: IQService) {
'ngInject';
}
constructor(private $q: IQService) {}

public buildNewServerGroupCommand(app: Application, defaults: any): IPromise<ICloudFoundryCreateServerGroupCommand> {
defaults = defaults || {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { ICloudFoundryServerGroup, ICloudFoundryEnvVar } from 'cloudfoundry/doma

export class CloudFoundryServerGroupTransformer {
public static $inject = ['$q'];
public constructor(private $q: ng.IQService) {
'ngInject';
}
public constructor(private $q: ng.IQService) {}

public normalizeServerGroupDetails(serverGroup: ICloudFoundryServerGroup): ICloudFoundryServerGroup {
return serverGroup;
Expand Down
1 change: 0 additions & 1 deletion app/scripts/modules/core/src/api/network.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class NetworkInterceptor implements IHttpInterceptor {
private $timeout: ITimeoutService,
private $injector: any,
) {
'ngInject';
this.$window.addEventListener('offline', this.handleOffline);
this.$window.addEventListener('online', this.handleOnline);
this.resetNetworkAvailable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class ApplicationStateProvider implements IServiceProvider {

public static $inject = ['stateConfigProvider'];
constructor(private stateConfigProvider: StateConfigProvider) {
'ngInject';
this.childStates.push(this.insightState);
}

Expand Down
Loading

0 comments on commit cc52bee

Please sign in to comment.