diff --git a/app/assets/javascripts/controllers/catalog/catalog_item_form_controller.js b/app/assets/javascripts/controllers/catalog/catalog_item_form_controller.js index 42f90876d541..153e136860b2 100644 --- a/app/assets/javascripts/controllers/catalog/catalog_item_form_controller.js +++ b/app/assets/javascripts/controllers/catalog/catalog_item_form_controller.js @@ -44,7 +44,7 @@ ManageIQ.angular.app.controller('catalogItemFormController', ['$scope', 'catalog ManageIQ.angular.scope = $scope; if (catalogItemFormId == 'new') { - vm.newRecord = true; + $scope.newRecord = true; vm.catalogItemModel.name = ''; vm.catalogItemModel.description = ''; vm.catalogItemModel.catalog_id = ''; @@ -58,7 +58,7 @@ ManageIQ.angular.app.controller('catalogItemFormController', ['$scope', 'catalog } else { vm.newRecord = false; catalogItemDataFactory.getCatalogItemData(catalogItemFormId).then(function (catalogItemData) { - vm.newRecord = false; + $scope.newRecord = false; vm.catalogItemModel.name = catalogItemData.name; vm.catalogItemModel.description = catalogItemData.description; vm.catalogItemModel.display = catalogItemData.display; diff --git a/app/views/catalog/_st_angular_form.html.haml b/app/views/catalog/_st_angular_form.html.haml index a903a18988dc..e850d724de9f 100644 --- a/app/views/catalog/_st_angular_form.html.haml +++ b/app/views/catalog/_st_angular_form.html.haml @@ -54,7 +54,7 @@ %select{"ng-model" => "vm._catalog", "name" => "catalog_id", "ng-required" => "vm.catalogItemModel.display", - 'ng-options' => 'catalog as catalog.name for catalog in catalogs', + 'ng-options' => 'catalog as catalog.name for catalog in vm.catalogs', 'pf-select' => true} %option{"value" => ""} = "<#{_('Choose')}>" diff --git a/app/views/layouts/angular/_ansible_form_options_angular.html.haml b/app/views/layouts/angular/_ansible_form_options_angular.html.haml index f973d2177973..1bf8b69335b4 100644 --- a/app/views/layouts/angular/_ansible_form_options_angular.html.haml +++ b/app/views/layouts/angular/_ansible_form_options_angular.html.haml @@ -110,7 +110,7 @@ %div{:class => "btn-container"} %button{:class => "btn btn-link", :type => "button", - "ng-click" => "addKeyValue('#{prefix}')", + "ng-click" => "vm.addKeyValue('#{prefix}')", "ng-disabled" => "(#{ng_model}.#{prefix}_key == '' || #{ng_model}.#{prefix}_value == '')"} %span{:class => "fa fa-plus tag-add"} @@ -136,15 +136,15 @@ -# %div{:class => "btn-container"} %td %div{"ng-if" => "#{ng_model}.#{prefix}_editMode && $index === #{ng_model}.s_index"} - %button{:class => "btn btn-primary", :type => "button", "ng-disabled" => "(#{ng_model}.key === '' || #{ng_model}.key_value === '')", "ng-click" => "saveKeyValue('#{prefix}', $index)"} + %button{:class => "btn btn-primary", :type => "button", "ng-disabled" => "(#{ng_model}.key === '' || #{ng_model}.key_value === '')", "ng-click" => "vm.saveKeyValue('#{prefix}', $index)"} =_("Save") - %button{:class => "btn btn-default", :type => "button", "ng-click" => "cancelKeyValue('#{prefix}', this.key, this.key_value, $index)"} + %button{:class => "btn btn-default", :type => "button", "ng-click" => "vm.cancelKeyValue('#{prefix}', this.key, this.key_value, $index)"} =_("Cancel") %div{"ng-if" => "!#{ng_model}.#{prefix}_editMode || (#{ng_model}.#{prefix}_editMode && $index !== #{ng_model}.s_index)", :class => "btn-container"} - %button{:class => "btn btn-link", :type => "button", "ng-click" => "editKeyValue('#{prefix}', this.key, this.key_value, $index)", "ng-disabled" => "#{ng_model}.#{prefix}_editMode"} + %button{:class => "btn btn-link", :type => "button", "ng-click" => "vm.editKeyValue('#{prefix}', this.key, this.key_value, $index)", "ng-disabled" => "#{ng_model}.#{prefix}_editMode"} %span{:class => "pficon pficon-edit"} - %button{:class => "btn btn-link", :type => "button", "ng-click" => "removeKeyValue('#{prefix}', this.key, this.key_value, $index)", "ng-disabled" => "#{ng_model}.#{prefix}_editMode"} + %button{:class => "btn btn-link", :type => "button", "ng-click" => "vm.removeKeyValue('#{prefix}', this.key, this.key_value, $index)", "ng-disabled" => "#{ng_model}.#{prefix}_editMode"} %span{:class => "pficon pficon-delete"} .form-group @@ -162,7 +162,7 @@ .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_dialog_id.$invalid}", "ng-if" => "#{ng_model}.#{prefix}_dialog_existing == 'existing'"} %select{"ng-model" => "vm._#{prefix}_dialog", "name" => "#{prefix}_dialog_id", - 'ng-options' => 'dialog as dialog.label for dialog in dialogs', + 'ng-options' => 'dialog as dialog.label for dialog in vm.dialogs', "ng-required" => "fieldsRequired('#{prefix}') && #{ng_model}.#{prefix}_dialog_existing == 'existing'", :checkchange => true, 'pf-select' => true}