meteor - How can I re-insert the values on a form, after a user clicks to edit something? -


i have single template that's wired show post if current user has post in collection. if not, automatically shows form.

now want add edit functionality. when user clicks on edit button,

  1. saves post text in variable.
  2. deletes post collection, template reactively reveals form again.

up part works. how can add text saved in variable, "input" element of form?

jquery works on console, don't know put in code.

on discover meteor, use router set context. i'd try idea jquery, if possible. thank you. suggestions welcome.

you keep post in session variable , in edit click handler, set session variable 1 you're viewing.

in form inputs, can set value attributes corresponding post values.

ex: <input name="title" value="{{post.title}}" />

and in template helper

template.form.helpers({      post: function() {         return session.get('post')     } }) 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -