i have object in array
var sidelist = [ { name:"murica", types:[...] } ];
i have box displays object's name. have text field , button. on button press object's name gets set text field value. don't know how make name in box change accordingly.
as understand putting object in session variable not option since not able modify properties of objects inside of without resetting whole session var. tried , failed.
html
<template name="asdf"> {{#with object}} <div>{{name}}</div> {{/with}} </template>
js
template.asdf.object = function() { return objects.findone(...); };
edit
i think i've got question wrong, sorry. if have value in memory you'd change , have dom updated, use dependencies:
html
<template name="asdf"> {{property}} </template>
js
var property; // create new dependency object manage refreshing property value: var _dep = new deps.dependency; updateproperty = function(value) { property = value; // whenever change value of property, call changed() function: _dep.changed(); }; template.asdf.value = function() { // within reactive function, call depend() rerun function // each time value changed: _dep.depend(); return value; };
Comments
Post a Comment