ManageIQ.angular.app.component('logCollectionForm', {
  controllerAs: 'vm',
  controller: logCollectionFormController,
  templateUrl: "/static/ops/log_collection/log_collection.html.haml",
  bindings: {
    'recordId': '@',
    'selectOptions': '<',
    'logCollectionFormFieldsUrl': '@',
    'saveUrl': '@',
    'logProtocolChangedUrl': '@',
  },

});

logCollectionFormController.$inject = ['$http', '$scope', 'miqService', 'miqDBBackupService'];
function logCollectionFormController($http, $scope, miqService, miqDBBackupService) {
  var vm = this;
  var init = function() {
    vm.logCollectionModel = {
      depot_name: '',
      uri: '',
      uri_prefix: '',
      log_protocol: '',
      log_userid: '',
      log_password: '',
    };
    vm.saveable = miqService.saveable;
    vm.afterGet = true;
    vm.modelCopy = angular.copy( vm.logCollectionModel );
    vm.logCollectionFormFieldsUrl = vm.logCollectionFormFieldsUrl;
    vm.logProtocolChangedUrl = vm.logProtocolChangedUrl;
    vm.saveUrl = vm.saveUrl;
    vm.prefix = 'log';
    vm.model = 'logCollectionModel';
    vm.miqDBBackupService = miqDBBackupService;
    ManageIQ.angular.scope = vm;

    if (vm.recordId == 'new') {
      vm.logCollectionModel.depot_name = '';
      vm.logCollectionModel.uri = '';
      vm.logCollectionModel.uri_prefix = '';
      vm.logCollectionModel.log_userid = '';
      vm.logCollectionModel.log_password = '';
      vm.logCollectionModel.log_protocol = '';
      vm.modelCopy = angular.copy( vm.logCollectionModel );
    } else {
      vm.newRecord = false;

      miqService.sparkleOn();

      var url = vm.logCollectionFormFieldsUrl;
      $http.get(url + vm.recordId)
        .then(getLogCollectionFormData)
        .catch(miqService.handleFailure);
    }
  };

  vm.validateClicked = function() {
    miqService.validateWithAjax(vm.saveUrl + '?button=validate&type=' + vm.prefix);
  };

  vm.logProtocolChanged = function() {
    miqService.sparkleOn();
    if (miqDBBackupService.knownProtocolsList.indexOf(vm.logCollectionModel.log_protocol) == -1 &&
       vm.logCollectionModel.log_protocol != '') {
      var url = vm.logProtocolChangedUrl;
      $http.get(url + vm.recordId + '?log_protocol=' + vm.logCollectionModel.log_protocol)
        .then(getLogProtocolData)
        .catch(miqService.handleFailure);
    }
    $scope.$broadcast('reactiveFocus');
    miqDBBackupService.logProtocolChanged(vm.logCollectionModel);
    miqService.sparkleOff();
  };

  vm.isBasicInfoValid = function() {
    return $scope.angularForm.depot_name.$valid &&
      $scope.angularForm.uri.$valid;
  };

  vm.saveClicked = function() {
    miqService.sparkleOn();
    var url = vm.saveUrl + vm.recordId + '?button=save';
    var moreUrlParams = $.param(miqService.serializeModel(vm.logCollectionModel));
    if (moreUrlParams) {
      url += '&' + decodeURIComponent(moreUrlParams);
    }
    miqService.miqAjaxButton(url, false);
  };

  vm.resetClicked = function(angularForm) {
    $scope.$broadcast('resetClicked');
    vm.logCollectionModel = angular.copy( vm.modelCopy );
    angularForm.$setPristine(true);
    miqService.miqFlash("warn", __("All changes have been reset"));
  };

  vm.cancelClicked = function() {
    miqService.sparkleOn();
    var url = vm.saveUrl + vm.recordId + '?button=cancel';
    miqService.miqAjaxButton(url, true);
  };

  vm.canValidateBasicInfo = function() {
    return vm.isBasicInfoValid();
  };

  function getLogCollectionFormData(response) {
    var data = response.data;

    vm.logCollectionModel.log_protocol = data.log_protocol;
    vm.logCollectionModel.depot_name = data.depot_name;
    vm.logCollectionModel.uri = data.uri;
    vm.logCollectionModel.uri_prefix = data.uri_prefix;
    vm.logCollectionModel.log_userid = data.log_userid;

    if (vm.logCollectionModel.log_userid !== '') {
      vm.logCollectionModel.log_password = miqService.storedPasswordPlaceholder;
    }

    vm.afterGet = true;
    vm.modelCopy = angular.copy( vm.logCollectionModel );

    miqService.sparkleOff();
  }

  function getLogProtocolData(response) {
    var data = response.data;

    vm.logCollectionModel.depot_name = data.depot_name;
    vm.logCollectionModel.uri = data.uri;
    vm.logCollectionModel.uri_prefix = data.uri_prefix;
    miqService.sparkleOff();
  }

  vm.$onInit = init;
}

@@ -862,161 +862,8 @@
  );%0A
-    vm.logCollectionFormFieldsUrl = vm.logCollectionFormFieldsUrl;%0A    vm.logProtocolChangedUrl = vm.logProtocolChangedUrl;%0A    vm.saveUrl = vm.saveUrl;%0A
     
@@ -881,16 +881,16 @@
  'log';%0A
+
     vm.m
@@ -1022,16 +1022,17 @@
 ordId ==
+=
  'new') 
@@ -1894,16 +1894,17 @@
 ocol) ==
+=
  -1 &&%0A 
@@ -1946,16 +1946,17 @@
 tocol !=
+=
  '') %7B%0A 
@@ -3382,251 +3382,29 @@
 odel
-.log_protocol = data.log_protocol;%0A    vm.logCollectionModel.depot_name = data.depot_name;%0A    vm.logCollectionModel.uri = data.uri;%0A    vm.logCollectionModel.uri_prefix = data.uri_prefix;%0A    vm.logCollectionModel.log_userid = data.log_userid
+ = angular.copy(data)
 ;%0A%0A 

Use angular.copy() instead of coping one by one, don't assign variable to itself, use === instead of ==