DailyJS

DailyJS

The JavaScript blog.


Tagviews
Featured

dom backbone views react

Backbone.React.Component, backbone-dom-view

Posted on .

Backbone.React.Component

If you like Facebook's React library and Backbone.js, then take a look at José Magalhães' Backbone.React.Component (GitHub: magalhas / backbone-react-component, License: MIT, Bower: backbone-react-component). It acts as a bridge so you can bind models, collections, and components on both the client and server.

The author has made a blog example that you can run locally. The server uses Express, and keeps collections updated with data both on the server and in the browser.

backbone-dom-view

backbone-dom-view (GitHub: redexp / backbone-dom-view, License: MIT, Bower: backbone-dom-view) by Sergii Kliuchnyk is a view class for Backbone that allows selectors to be bound to helper methods using a shorthand notation that supports binding model fields, view events, and calculations.

Sergii's example is a to-do model:

View = Backbone.DOMView.extend  
  template:
    '.title':
      html: '@title'
    '.state':
      class:
        'done': '@is_done'

It has RequireJS support, tests, and documentation in the readme.