Last active
August 29, 2015 13:58
-
-
Save hellogerard/9967016 to your computer and use it in GitHub Desktop.
[blaze] Meteor autofocus reactivity bug (https://github.com/meteor/meteor/issues/2011)
This file contains 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>cow</title> | |
</head> | |
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
<h1>Hello World!</h1> | |
{{greeting}} | |
<input type="button" value="Click" /> | |
<input type="text" value="{{dog}}"> | |
</template> |
This file contains 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.isClient) { | |
Template.hello.greeting = function () { | |
return "Welcome to cow."; | |
}; | |
Template.hello.dog = function () { | |
return Session.get('dog'); | |
}; | |
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.isServer) { | |
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