javascript - Meteor two way data binding for form validation -


I've read a lot of resources about Blaze allowing reactive rendering Meteor 0.8, but for me it No solution can be found, my simple problem is below.

I have my form I am trying to validate input simplicity, I say that I am your {{message}} would change when a form is submitted. The approach taken in client.js is simply giving a new value for the assist variable. How did I work with AngularJS in this way, but more than just changing the bus in the meteor, how do I take it? - index.html & lt; Template name = "user" & gt; & Lt; Form & gt; & Lt; Input type = "text" id = "name" & gt; & Lt; P & gt; {{Message}} & lt; / P & gt; & Lt; Button class = "submit" onclick = "return false;" & Gt; Submit & lt; / Button & gt; & Lt; / Form & gt; & Lt; / Template & gt; - client.js Template.user.message = ""; Template.user.events = {'click .submit' = function () {Template.user.message = "valid"; }}

If you use a responsive variable so it should work I I will use a session variable in this example:

  Template.user.message = function () {return Session.get ( 'userMessage'); }; Template.user.events ({submit: function () {session.set ('user message', 'valid');}});   

Note is the event takes an object (to address events specified instead click handler to a value in the map).

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -