ManageIQ.angular.app.component('miqButton', {
  bindings: {
    name: '@',
    enabled: '<',
    enabledTitle: '@?',
    disabledTitle: '@?',
    primary: '<?',
    onClick: '&',
  },
  controllerAs: 'vm',
  controller: function() {
    this.buttonClicked = function() {
      if (this.enabled) {
        this.onClick();
      }
    };
    this.setTitle = function() {
      if (this.enabledTitle || this.disabledTitle) {
        this.title = this.enabled ? this.enabledTitle : this.disabledTitle;
      }
    };
    this.$onInit = function() {
      this.setTitle();
    };
    this.$onChanges = function(changes) {
      if (changes.enabled) {
        this.enabled = changes.enabled.currentValue;
        this.setTitle();
      }
    };
  },
  template: [
    '<button',
    'controllerAs="vm"',
    'ng-class="{btn: true, \'btn-primary\': vm.primary, \'btn-default\': !vm.primary, disabled: !vm.enabled}"',
    'ng-click="vm.buttonClicked()"',
    'ng-attr-title="{{vm.title}}"',
    'ng-attr-alt="{{vm.title}}">',
    '{{vm.name}}',
    '</button>'
  ].join("\n")
});

ManageIQ.angular.app.component('miqButton', {
  bindings: {
    name: '@',
    enabled: '<',
    enabledTitle: '@?',
    disabledTitle: '@?',
    primary: '<?',
    onClick: '&',
  },
  controllerAs: 'vm',
  controller: function() {
    this.buttonClicked = function(event) {
      if (this.enabled) {
        this.onClick();
      }
      event.preventDefault();
    };
    this.setTitle = function() {
      if (this.enabledTitle || this.disabledTitle) {
        this.title = this.enabled ? this.enabledTitle : this.disabledTitle;
      }
    };
    this.$onInit = function() {
      this.setTitle();
    };
    this.$onChanges = function(changes) {
      if (changes.enabled) {
        this.enabled = changes.enabled.currentValue;
        this.setTitle();
      }
    };
  },
  template: [
    '<button',
    'controllerAs="vm"',
    'ng-class="{btn: true, \'btn-primary\': vm.primary, \'btn-default\': !vm.primary, disabled: !vm.enabled}"',
    'ng-click="vm.buttonClicked($event)"',
    'ng-attr-title="{{vm.title}}"',
    'ng-attr-alt="{{vm.title}}">',
    '{{vm.name}}',
    '</button>'
  ].join("\n")
});

Add $event to onClicked function so it doesn't go to form
Add $event to onClicked function so it doesn't go to form
