https://github.com/onehilltech/ember-cli-input-helpers
https://github.com/onehilltech/ember-cli-input-helpers
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/onehilltech/ember-cli-input-helpers
- Owner: onehilltech
- License: apache-2.0
- Created: 2018-10-05T15:50:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-21T03:15:47.000Z (over 2 years ago)
- Last Synced: 2025-01-26T19:44:10.375Z (3 months ago)
- Language: JavaScript
- Size: 643 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-cli-input-helpers
==============================================================================Helper functions for binding HTML input elements to properties.
## Install
ember install ember-cli-input-helpers
## Features
* Computed properties for transforming input strings to JavaScript objects
* Works well with Ember.Data## Usage
### Date
Use the `date` computed property to convert the date input string to/from a
JavaScript `Date` object.```javascript
import { date as dateInput } from 'ember-cli-input-helpers/computed';const Person = DS.Model ({
// The birthday as a date type.
birthday: DS.attr ('date'),
// Property specifically for inputs.
birthdayInput: dateInput ('birthday')
});
```Then use the `birthdayInput` property in the `{{input}}` helper, and not `birthday`
property.```html
{{input value=model.birthdayInput}}
```