Skip to content

Commit 90614bd

Browse files
committed
added click event
Signed-off-by: Efren Lim <[email protected]>
1 parent 226706f commit 90614bd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<button
22
class="lfx-button lfx-button--{{ type().toLowerCase() }}"
33
[disabled]="disabled()"
4+
(click)="onClick()"
45
>
56
<ng-content />
67
</button>

projects/lfx-component-lib/src/lib/controls/buttons/buttons.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, input } from '@angular/core';
1+
import { Component, input, output } from '@angular/core';
22

33
export type IButtonType = 'primary' | 'secondary' | 'tertiary';
44

@@ -12,4 +12,10 @@ export type IButtonType = 'primary' | 'secondary' | 'tertiary';
1212
export class ButtonsComponent {
1313
type = input<IButtonType>('primary');
1414
disabled = input<boolean>(false);
15+
16+
click = output<void>();
17+
18+
onClick() {
19+
this.click.emit();
20+
}
1521
}

0 commit comments

Comments
 (0)