TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Spellbinder, real-time view/model binding for backbone.js

21 点作者 mattinsler大约 12 年前

3 条评论

jashkenas大约 12 年前
Pretty sweet. And an interesting implementation: <a href="https://github.com/mattinsler/spellbinder/blob/master/src/spellbinder.coffee" rel="nofollow">https://github.com/mattinsler/spellbinder/blob/master/src/sp...</a> (although more comments would be lovely). For prior art, see:<p><a href="http://rivetsjs.com" rel="nofollow">http://rivetsjs.com</a><p><a href="http://nytimes.github.io/backbone.stickit/" rel="nofollow">http://nytimes.github.io/backbone.stickit/</a><p>But I have to say, that "example" is a pretty puffed up strawman. Most of the time, the real comparison is this:<p><pre><code> &#60;p data-bind="count; [class:high-value] count &#62; 100; [class:low-value] count &#60; 50"&#62;&#60;/p&#62; </code></pre> To this:<p><pre><code> &#60;p class="&#60;%= count &#62; 100 ? 'high-value' : (count &#60; 50 ? 'low-value' : '') %&#62;"&#62;&#60;/p&#62;</code></pre>
评论 #5727547 未加载
JesseObrien大约 12 年前
Nothing against the author at all, this seems like a cool little project, but I would never want to inline that much anything on a large project. Inlining things like that takes the maintainability and throws it out the window.
评论 #5727551 未加载
hayksaakian大约 12 年前
isn't there a way to solve this with CSS3?<p>or at the very least, at the LESS/SCSS level?