{"size": 1121, "ext": "js", "max_stars_repo_path": "packages/azure/src/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.js", "max_stars_repo_name": "kskewes-sf/deck", "max_stars_repo_stars_event_min_datetime": "2015-11-16T17:55:07.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T04:34:56.000Z", "max_issues_repo_path": "packages/azure/src/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.js", "max_issues_repo_name": "kskewes-sf/deck", "max_issues_repo_issues_event_min_datetime": "2015-11-18T23:32:02.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-29T06:56:59.000Z", "max_forks_repo_path": "packages/azure/src/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.js", "max_forks_repo_name": "kskewes-sf/deck", "max_forks_repo_forks_event_min_datetime": "2015-11-16T19:34:42.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-28T18:31:34.000Z"}
{"max_stars_count": 291, "max_issues_count": 3413, "max_forks_count": 1114, "avg_line_length": 32.0285714286, "max_line_length": 136, "alphanum_fraction": 0.6859946476}
'use strict';

import { module } from 'angular';

import { ModalWizard } from '@spinnaker/core';

export const AZURE_SERVERGROUP_CONFIGURE_WIZARD_IMAGESETTINGS_SERVERGROUPIMAGESETTINGS_CONTROLLER =
  'spinnaker.azure.serverGroup.configure.imageSettings.controller';
export const name = AZURE_SERVERGROUP_CONFIGURE_WIZARD_IMAGESETTINGS_SERVERGROUPIMAGESETTINGS_CONTROLLER; // for backwards compatibility
module(AZURE_SERVERGROUP_CONFIGURE_WIZARD_IMAGESETTINGS_SERVERGROUPIMAGESETTINGS_CONTROLLER, []).controller(
  'azureServerGroupImageSettingsCtrl',
  [
    '$scope',
    function ($scope) {
      this.clearImage = function () {
        if ($scope.command.image.isCustom == false) {
          $scope.command.image = { isCustom: false };
        } else {
          $scope.command.image.region = $scope.command.region;
        }
      };

      ModalWizard.markComplete('image-settings');

      $scope.$watch('form.$valid', function (newVal) {
        if (newVal) {
          ModalWizard.markClean('image-settings');
        } else {
          ModalWizard.markDirty('image-settings');
        }
      });
    },
  ],
);
