README
@skyux/autonumeric
Usage
Add the autonumeric attribute to an input element.
<input
type="text"
skyAutonumeric
>
To use a predefined set of options:
<input
type="text"
skyAutonumeric="dollar"
/>
To use a custom set of options:
<input
type="text"
[skyAutonumeric]="{ decimalPlaces: 5 }"
/>
Global Configuration
To configure all skyAutonumeric
instances in your SPA the same way, create a class that extends the base class SkyAutonumericOptionsProvider
and supply it in the module providers.
my-autonumeric-options-provider.ts
export class MyAutonumericOptionsProvider extends SkyAutonumericOptionsProvider {
constructor() {
super();
}
public getConfig(): SkyAutonumericOptions {
return {
decimalPlaces: 5
};
}
}
app.module.ts
providers: [
{
provide: SkyAutonumericOptionsProvider,
useClass: MyAutonumericOptionsProvider
}
]
Install dependencies and view the example
skyux install
skyux serve