I'm looking to create a textbox that only accepts numbers using bindable property instead of oninput. Could someone provide guidance on how to achieve this?
textbox.html
<template bindable="">
<input style="
box-sizing: border-box;"
maxlength="10" ;
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" />
</template>;
textbox.ts
import { bindable } from 'aurelia-framework';
export class textbox {
constructor() {
}
}
app.html
<template bindable="">
<require from="./components/textbox.html"></require>
<textbox></textbox>
</template>
app.ts
export class App {
}