Hey folks
Short question. We have a custom element with a callback attribute. This callback attribute might be undefined (generic stuff). Since Aurelia wraps a function around passed value, even if value is undefined, we have no idea how to check it.
// fancy custom element
export class FancyCustomElement {
//this guy might be undefined but Aurelia wraps a function which makes it impossible to check if it's undefined.
@bindable public onChange?: () => void;
}
<!-- model view -->
<template>
<fancy on-change.call="onChange()"></fancy>
</template>
// view model
export class ViewModel {
public onChange = undefined;
}
Thanks for your help