Skip to content
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

Getting started, "Template7" undefined #31

Open
codetuner opened this issue Mar 10, 2017 · 1 comment
Open

Getting started, "Template7" undefined #31

codetuner opened this issue Mar 10, 2017 · 1 comment

Comments

@codetuner
Copy link

I'm trying a first "getting started" page with Template7 but I'm stuck...

What is wrong with the following code ? I get "'Template7' is undefined" error.

All referred js files are accessible, I get no 404 errors, only 200.

<html>
<head>
<script src="template7.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
$(function() {
	var template = $("#template").html();
	var compiledTemplate = Template7.compile(template);  // Error here
	jQuery.getJSON("http://api.fixer.io/latest", null, function(data) {
		$("#result").html(compiledTemplate(data));
	});
});
</script>
</head>
<body>

<div id="result"></div>

<script id="template" type="text/template7">
    <p>Base currency: {{base}}</p>
</script>

</body>
@benyaminshoham
Copy link

Are you missing a $ here??
var template = $$('#template').html();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants