charlieridley / ember-typeahead

EmberJS autocomplete component using typeahead.js
MIT License
78 stars 17 forks source link

Add "contents" interface to the componant #13

Open boazsender opened 10 years ago

boazsender commented 10 years ago

This PR adds a contents interface that allows you to bind to the actual value of the input.

This is useful for the case where you want access to the text content inside of the type ahead. My use case is to create a type ahead that allows users to select an existing entity, or create a new one.

I tested this in the application I am currently working on, and it works without regressions.

I also updated the readme to document this feature.

I did not build the dist, or bump the version as I figured I'd let the maintainer do the honors, but this does feel like a minor version bump to me.

While I was at it, I also cached the jQuery input selection for better performance.

boazsender commented 10 years ago

What do you think about this PR @charlieridley ?

charlieridley commented 10 years ago

Hey sorry I missed this. How is this different from binding to value? The component extends Ember.TextField

ebrelsford commented 10 years ago

I had a similar use case and your comment helped a ton, @charlieridley