twitter/bootstrap — pull request #1751 by cgunther (2012-02-05 22:19:03+00:00)
Title: Allow Typeahead to accept array of objects

I've modified the plugin to accept either an array of strings (current implementation) or an array of objects that have `label` and `value` properties, like so:

```javascript
[
{ label: 'California', value: 'CA' },
{ label: 'New York', value: 'NY' }
]
```

I also added a `selected` event that fires when the user selects an item from the results and passes the item that was selected.

This is a big change, but in my testing, should be fully backwards compatible with 2.0.0.

This is similar to, and may suffice for, #1593, #1518, and #1551.

It's also fully documented. I'd add to the test suite, but I've never dabbled in QUnit, so I'll have to bush up on that first.