Skip to content

Instantly share code, notes, and snippets.

@Blazing-Mike
Created September 7, 2024 12:57
Show Gist options
  • Save Blazing-Mike/ad03f57978a7ad6114ce36693084d471 to your computer and use it in GitHub Desktop.
Save Blazing-Mike/ad03f57978a7ad6114ce36693084d471 to your computer and use it in GitHub Desktop.
import {
Component,
Input,
EventEmitter,
Output,
ChangeDetectionStrategy,
} from '@angular/core';
@Component({
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ButtonComponent {
@Input() loading: any;
@Input() buttonText = '';
@Input() buttonType: 'submit' | 'button' = 'button';
@Input() buttonStyles = '';
@Output() buttonClick = new EventEmitter<string>();
constructor() {}
onButtonClick(): void {
this.buttonClick.emit('clicked');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment