Ember Select Light is an Ember Addon written data-down, actions up (DDAU) written with in test-driven development practices.
The intent is to provide a barebones <select> element that pairs well with modern Ember practices without styling assumptions. The result is a very functional, yet customizable, option for developers seeking a simple solution to select elements in their forms and apps.
ember install ember-select-lightember serve- Visit your app at http://localhost:4200.
npm run lint:hbsnpm run lint:jsnpm run lint:js -- --fix
We love pull requests from everyone. By participating in this project, you agree to abide by the code of conduct and is subject to the project license.
Clone this repo, make your changes with test coverage, push up a fork and submit a pull request.
Soon after some primary contributors will review your code and submit feedback and hopefully click the fancy green approve button. Any test and linting failures should be caught during the pull request continuous integration environment and human eyes here after.
npm run test(Runsember try:eachto test your addon against multiple Ember versions)- or
ember test
this.setProperties({
myValue: 'turtle',
myOptions: ['turtle', 'tortoise'],
myAction: (event) => {
console.log(event.target.value);
},
});String that matches the selected <option value="....
['clam', 'starfish'][
{ value: 'shortfin', label: 'Shortfin Shark' },
{ value: 'mako', label: 'Mako Shark' },
]value and label will be the default keys used unless valueKey="... and/or displayKey="... are used respectively.
Any javascript event can be handled directly on the component such as change or focusIn. The event javascript object is passed along to be used however you desire.
Common usages are...
myAction(event) {
console.log(event.target.value); // Do something useful with the changed value
},or to modify a property without a custom action...
disabled, tabindex, and class work as you'd expect.