tmpvar / weld

Template antimatter for Node.js (Browsers too!)
674 stars 39 forks source link

Updating attributes #5

Closed indeox closed 13 years ago

indeox commented 13 years ago

Just a possible feature request on an otherwise amazing script... would it be possible to update attributes using the appropriate selectors in the bind config?

ex: weld(".entries .entry", data, { bind: { "id" : ".title[id]" } });

heapwolf commented 13 years ago

we're actually working on a rewrite, it should clarify a lot of features as well as make jQuery optional. We actually going to rename 'bind' to 'alias'. i think it's more self-describing. I think that your request is interesting, but it would imply parsing selectors, which would be more complex that it seems because it would require special syntax to indicate what to replace inside the selector string. Im open to implementation ideas, but you may want to wait until we release 0.2.0 which could be tonight or tomorrow.

indeox commented 13 years ago

Ah great! It was just an idea, but I know that it opens a whole new can of worms.

It was more to cover situations where for example you'd want to update the width/height values of an

But you're right, it also raises the question of what or even how to replace inside the selector. For example if you have markup in one of the values, should there be an option to replace the contents with .html() instead of the current .text(). But that's more of question for version 2.0.0 :-)

heapwolf commented 13 years ago

you're very correct, this stuff will be considered in 0.2.0, which should be very soon!!