twitter/bootstrap — pull request #6069 by elmariachi111 (2012-11-29 22:41:26+00:00)
Title: use a textproperty parameter on Typeahead to identify a source result object's property. 

This commit allows Typeahead users to query a remote API and keep their results. After a user selects an item from the list the updater has access to the original response object to trigger another action (provide your own updater function). Makes use of the data-attribute pull request as suggested here:
martinnormark: https://github.com/twitter/bootstrap/pull/6015

added a textproperty function on Typeahead.prototype that pulls the correct property from the result. Puts more logic to Typeahead base, leaves less work to the client (as supposed in #6015)

Tested against local PhantomJS test (make test)

Usage example:
```javascript
$element.typeahead( {
textproperty: function(item) {
return item.formatted_address; //choose the text field of the result object
}, updater: function(item) {
console.dir(item); //do something with the result object / callback / move map marker etc.
return this.text(item); //aka super(item)
}

}
```