-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precompiler Issue?? #734
Comments
Hi
|
Hi, Uncaught TypeError: Property 'template' of object [object Object] is not a function Help me please ? |
Thanks r3to that worked perfectly. I did as you said, recompiled the file and switched to the run time handlebars. To find out it all works!! Some needs to amend the handlebars website to accommodate for this is as I think it would be a fairly common issue. |
Hi OAFCROB , can you help me please ?? |
Yes, what's the problem? Firstly have you seen handlebars build your template in the normal format? If so have you got the runtime version downloadable from; http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.runtime-v1.3.0.js Have you got node.js installed and the compiler installed as r3to stated? Build the precompiled file via CLI by changing into the directory of the file i.e /pages Then run, remembering to replace your files between the << and >> but don't include them handlebars <> -f <> -m Hit return you should see the new file in the directory. Now include this into the header tags i.e. <script type="text/javascript" src="/scripts/lib/handlebars.runtime-v1.3.0.js"></script> <script type="text/javascript" src="/pages/footer.template.js"></script>Then on document.ready or what have you, put something on the lines of; var data = {
|
Thank's Uncaught TypeError: Property 'template' of object [object Object] is not a function When I execute the following line , this result is : (function() { My version of handlebars and handlebars.runtime is 1.3.0 |
Updated my previous comment, a little step by step guide to how I did |
thank's |
You should be able to find it within the folder you changed to. |
thank's ;) |
Glad I could help :-D |
i installed handlebar using >> npm uninstall handlebars -g |
npm uninstall handlebars -g |
Thanks OAFCROB |
First I'm using the following;
I have created a simple template called it "footer.handlebars" passed it into the CLI compiler with the following command;
handlebars footer.handlebars -f footer.template.js -m
I then include the footer.template.js after the handlebars itself and have a call to the template as follows;
var data = {
productType: 'APP',
appName : 'Test',
appVersion : '1.0',
currentYear: new Date().getFullYear()
};
This is bound to the document.ready command of jQuery and there is the containing div footerContainer for the template to populate into.
At run time I get the following error;
TypeError: Object # has no method 'call' at line 436 http://localhost/scripts/lib/handlebars.runtime-v1.3.0.js
First of all I'm not sure if I have done something wrong, so it could be human error. Or whether there is a known bug with the version of jQuery or handlebars etc...
The text was updated successfully, but these errors were encountered: