element.typeahead is not a function - at initialize (http://localhost:8100/js/directives/angular-typeahead.js:102:21)
Closed this issue · 10 comments
My index.html:
<script src="lib/typeahead.js/typeahead.jquery.min.js"></script> <script src="lib/typeahead.js/bloodhound.min.js"></script> <script src="js/directives/angular-typeahead.js"></script>Does this mean that typeahead is not defined for some reason?
Sorry that is the order in which I am loading the files, so typeahead should be defined in time. It works if I type $("input").typeahead after the browser has loaded, just can't get it to work immediately
I have this issue too - I'm loading JQuery, then Bloodhound, typeahead.query and angular-typeahead. Did you manage to solve it?
same issue here. did you guys find a solution? it happened after i setup another computer and installed the latest versions of the libraries.
it worked for me again using angular-typeahead@0.2.1 and typeahead.js@0.10.1
Closing now as it should not be an issue in v1 anymore
I'm getting this exact problem with
"angular-typeahead": "1.0.2",
"typeahead.js": "0.11.1"
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/typeahead.js/dist/bloodhound.js"></script>
<script src="node_modules/typeahead.js/dist/typeahead.jquery.js"></script>
<script src="node_modules/angular-typeahead/dist/angular-typeahead.js"></script>
@tommck Could you provide a runnable example? I tested those versions in the plunkr demo it works just fine.
Figured it out. You have to include jquery BEFORE angularjs, since it's relying on "$element" to be jQuery and not jqLite
oh, FYI: your example code (plnkr) is using ancient angularjs ;)