ember-simple-select

0.6.1 • Public • Published

Ember-simple-select Travis-CI badge

this Repo is a shameless copy/paste from this JSBin.

It offers a {{simple-select}} component that comes as a replacement for the deprecated Ember.Select, while following all the Ember 2.0 guidelines.

Installation

$ ember install ember-simple-select

ember-get-helper is required for ember 1.13.

Usage

{{# With `selection`, you give an object
    that corresponds to the selection}}
{{simple-select
    content=yourData
    optionValuePath="id"
    optionLabelPath="displayName"
    selection=currentlySelectedObject
    prompt="Please select a value"
    action=doSomethingWhenTheSelectionChanged}}
 
{{# Here you give the value}}
{{simple-select
    content=yourData
    optionValuePath="id"
    optionLabelPath="displayName"
    value=currentlySelectedValue
    prompt="Please select a value"
    action=doSomethingWhenTheSelectionChanged}}

If you want to use the prompt as an empty value, you can do that by using the allowEmpty property:

{{simple-select
    ...
    prompt="Please select a value"
    allowEmpty: true}}

Receiving actions

The receiving actions will be called with 2 arguments:

  • The selection, which is the object that corresponds to the selected entry from content.
  • The value that is the actual value in the <option> tag (resolved by optionValuePath).

Contribute

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Readme

Keywords

Package Sidebar

Install

npm i ember-simple-select

Weekly Downloads

1

Version

0.6.1

License

MIT

Last publish

Collaborators

  • xcambar