-
Hi, does anyone know how to call a service from a Kolibri event? constructor(private heroService: HeroService) {}
onKolibriButtonClick() {
console.log('Kolibri event')
this.heroService.hero('onKolibriButtonClick')
}
onButtonClick() {
console.log('Button event')
this.heroService.hero('onButtonClick')
} <kol-button [_on]="{onClick: onKolibriButtonClick }" _label="Klick mich!" ></kol-button>
<button (click)="onButtonClick()" >Native Button</button> I receive an error when clicking the Kolibri Button:
|
Beta Was this translation helpful? Give feedback.
Answered by
bastiW
Nov 29, 2023
Replies: 1 comment
-
Just found the solution: <kol-button [_on]="buttonCallbacks" _label="Klick mich - callback" ></kol-button> import {ButtonCallbacksPropType} from "@public-ui/components";
buttonCallbacks: ButtonCallbacksPropType<any> = {
onClick: () => {
console.log('Button event')
this.heroService.hero('buttonCallbacks - click')
}
};
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bastiW
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just found the solution:
Code Sandbox