Created
May 27, 2012 04:51
-
-
Save kvprashant/2802217 to your computer and use it in GitHub Desktop.
meteorjs 'Uncaught ReferenceError: Template is not defined' error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CSS declarations go here */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>myapp</title> | |
</head> | |
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
<h1>Hello! Meteor is awesome!</h1> | |
{{greeting}} | |
<input type="button" value="Click" /> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.is_client) { | |
Template.hello.greeting = function () { | |
return "Welcome to myapp."; | |
}; | |
Template.hello.events = { | |
'click input' : function () { | |
// template data, if any, is available in 'this' | |
if (typeof console !== 'undefined') | |
console.log("You pressed the button"); | |
} | |
}; | |
} | |
if (Meteor.is_server) { | |
Meteor.startup(function () { | |
// code to run on server at startup | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
notice html within h1 tag is changed. Nothing else.