Reputation: 81
This question is from this thread:
Twitter Typeahead.js with Flask Jinja2 Templating
As suggested, I am trying to separate my js file. Here is the code
$('#search').typeahead({
name: 'Search',
local: {
value: 'String',
tokens: ['Test1','Test2']
language: 'English'
},
template: {{language}},
engine: Hogan
});
I understand what the problem is, but how do I "include" hogan.js? I have installed node.js and I can make it work through that, however, I don't understand how to apply it through flask.
Upvotes: 2
Views: 153
Reputation: 2162
If you are including a static file you can use Flask's url_for.
http://flask.pocoo.org/docs/quickstart/#static-files
Upvotes: 1