I bought this template https://wrapbootstrap.com/theme/unify-responsive-website-template-WB0412697. After I extract the zip file, I got a folder with the following structure.
|–assets
| |—css
| |—app.css
| |—js
| |—App.js
| |—img
| |—a.png
|—index.html
If I directly open index.html from chrome, it works fine. But when I integrate with a new meteor project, I got the following error ‘Uncaught ReferenceError: App is not defined’
The way I integrate meteor with this html template is
- put assets into public folder
- put index.html into client folder wrapped by a template
After some investigation, I found the problem is in index.html(taken from original index.html), it has some code like this at the bottom
----------content in bottom of index.html
--------content in app.js
var App = function () {
// We extend jQuery by method hasAttr
$.fn.hasAttr = function(name) {
return this.attr(name) !== undefined;
};
App.init(); this line throws error ‘Uncaught ReferenceError: App is not defined’. I am guessing this part of the code load before loading assets/js/app.js.
Maybe I am doing it wrong, I should put code in a template onrendered function? anyway, I am new to meteor, can someone help me to solve this problem or tell me how to do it properly