sgruhier/typeahead-addresspicker

Uncaught ReferenceError: Bloodhound is not defined

Closed this issue · 2 comments

  1. Have included google map and typeahead.Jquery is added through a gem and referenced in application.js
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en-US"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.9.3/typeahead.min.js"></script>
<script type="text/javascript" src="https://rawgithub.com/sgruhier/typeahead-addresspicker/master/dist/typeahead-addresspicker.js"></script>

2)Have added input text

<input id="address" type="text" placeholder="Enter an address">

3)Have instantiated address picker and typeahead.

$(document).on('ready page:load', function () {

    var addressPicker = new AddressPicker();

             $('#address').typeahead(null, {

                              displayKey: 'description',

                              source: addressPicker.ttAdapter()

              });

});

you should include typeahead.bundle.js which has typeahead + bloodhound
look at demo here https://twitter.github.io/typeahead.js/examples/, they include https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.js

I don't know which version is on cloudflare

Yes that was the issue.Have closed the issue,thanks