ember install ember-amount-input
or
yarn install -D ember-amount-input
or
npm install --save-dev ember-amount-input
or
pnpm install -D ember-amount-input
Argument | Type | Required | Description |
---|---|---|---|
currency | string | false | The currency displayed in the input. |
disabled | boolean | false | A boolean argument that can be used to disable the input. |
inputClass | string | false | A custom class to apply on the input. |
inputId | string | false | A custom id to apply on the input. |
numberOfDecimal | number | false | The number of decimal to use for the value. |
placeholder | string | false | The placeholder used by the input. |
step | number | false | The interval for the input field. Some browser also use it to validate the value if used in a form. |
update | function | true | A function triggered with the new value. Use it to update your value. |
value | number | true | The input's value. It should be updated using the update argument. |
The AmountInput
component has proper Glint types, which allow you to get strict type checking in your templates when using TypeScript.
Unless you are using strict mode templates (via first class component templates), you need to import the addon's Glint template registry entries as described in the Using Addons documentation:
// e.g. types/glint.d.ts
import "@glint/environment-ember-loose";
import type AmountInputRegistry from "ember-amount-input/template-registry";
declare module "@glint/environment-ember-loose/registry" {
export default interface Registry
extends AmountInputRegistry /* other addon registries */ {
// local entries
}
}