Hello, this is the following, I would like to know how do I start typing something in the input, automatically update a helper to be shown in the template.
I've tried it that way, but it's not changing in real time:
Template.hello.onCreated(function(){
this.name = new ReactiveVar();
})
Template.hello.helpers({
name: function(){
return Template.instance().name.get();
}
})
Template.hello.events({
'change input' : function(){
var inputName = document.querySelector('input');
Template.instance().name.set(inputName.value);
}
})
I also tried the 'focus' event, but it did not work
index.html
{{> hello }}
<template name="hello">
<input type="text" name="name">
<p>Hello {{name}}</p>
</template>