I am having the same issue mentioned here
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source='["Amsterdam", "Maastricht"]' />
does work, but when using double quotes like
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="['Amsterdam', 'Maastricht']" />
it won't work.
I infact uses it with Angular + Angular-ui
<input type="text" ng-model="mymodel" placeholder="Cities.."
ui-jq="typeahead" ui-options="{source:cities}"/>
$scope.cities =["D","A"]
Typeahead works if I change it to
$scope.cities =['D','A']
Do I need to convert my array with double quoted string? How. Is there a way to do this by native json.
thanks.
I'm not familiar with Angular-UI, but it almost sounds like it's doing a replacement of $eval'ed items in that ui-options attribute... so you end up with something like ui-options="{source:["D","A"]}"
EDIT: So like you said in your comment, wrap it in single quotes.