Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created September 13, 2018 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lydemann/8d89f0c2d54fa952e9646bafd1e44c2a to your computer and use it in GitHub Desktop.
Save lydemann/8d89f0c2d54fa952e9646bafd1e44c2a to your computer and use it in GitHub Desktop.
import { EventEmitter, Input, Output } from '@angular/core';
export abstract class ButtonParentComponent<ButtonTypes = any> {
@Input() public type: 'button' | 'submit' = 'button';
@Input() public buttonType: ButtonTypes;
@Input() public iconButton = false;
@Input() public text = '';
@Input() public disabled = false;
@Input() public buttonStyle: { [key: string]: string };
@Input() public buttonClass: { [key: string]: boolean };
@Output() public clicked = new EventEmitter<void>();
public onClick() {
if (!this.disabled) {
this.clicked.emit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment