Skip to content

Comment on Rivets.js - Binding data to viewsparent

Comments

But on the other hand the view has to know about the template.

Change a tag name or class name (which I think is far more common than attribute names) would then break the relationship.

This is true. However, the view already has to know about the template. The only difference is the how much it knows. It will add some extra responsibility if you change your classes a lot but I think I might prefer that over muddying the html with attributes and filters. Another thing that would be cool about a hash in the view is you could apply filters and presentation logic to the values there in a DRY way. Hope my tone doesn't come across as combative or dismissive. Thanks for taking the time to open source your code. I've just been thinking a lot about this recently.

Hehe, it's not actually my code, I just found this gem and I liked it :)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.