As set of handlebar helpers for Ember 1.13.11 and higher. Uses bootstrap for styling.
npm install --save em-helpers
ember test
ember server
- Visit your app at http://localhost:4200.
- When value is
undefined
ornull
, txt displays a 'Not Available' message - If the formatter function (built-in/external) throws an error; the error will be logged and an 'Error!' message will be displayed
- Supported values =
date, duration, number or memory
- txt uses momentjs for formatting date & duration, and numeraljs for formatting numbers
- Other parameters depend on the type
- momentjs is used for formatting
- With date, value can be a date object, date string or number of milliseconds
- internal date formatter will perform all the parsing, and conversions
- Supported extra properties
- format - Displayed date format. Default value is
DD MMM YYYY HH:mm
- timeZone - Displayed date time zone. Default is local time zone.
- valueFormat - Format of incoming date string
- valueTimeZone - Time zone of incoming value. Default value is
UTC
- format - Displayed date format. Default value is
- momentjs is used for formatting
- Expects value to be of number type
- End result will be of the format
Y years M months D days h hours m minutes s seconds
- Supported extra properties
- valueUnit - Can be used to specify the unit of incoming value. It can be either of the string mentioned here
- numeraljs is used for formatting
- Supported extra properties
- format - Can be any of the format strings mentioned here. Default value is
0,0
.
- format - Can be any of the format strings mentioned here. Default value is
- A short had for
type='number'
&format='0 b'
- Pretty prints an object in an indented JSON representation. Uses JSON.stringify internally.
- Supported extra properties
- replacer - Same as JSON.stringify replacer
- space - Same as JSON.stringify space. Defaults to 4 spaces
- An optional callback function to create custom formatting.
- Will be called with two values;
value
and propertyhash
passed into the helper - Returned value must support
toString
method.
- Current value to be displayed
- Defaults to 0
- Progress would be calculated from this value
- Defaults to 1
- Progress would be calculated to this value
- Adds candy stripes to the progress-bar
- Also the bar is animates when valueMin < value < valueMax
- Use this param to color the progress bar
- All styles provided by bootstrap are supported
- Available values are success, info, warning & danger
Each item object can have the following properties.
- The link display text
- When specified the item will be a link-to the respective route
- If you want to route to a specific model/id as dynamic segment
- To have multiple dynamic segments pass an object of values, and use a serialize hook
- This creates an anchor tag instead of ember's link-to
- Useful for linking to external resources
- Must be an array of css class names