Socket
Socket
Sign inDemoInstall

muscle

Package Overview
Dependencies
273
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    muscle

A layer on top of Backbonejs to bring more control to views and a better integration between views and models/collections


Version published
Weekly downloads
6
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Muscle.js

browser support

A layer on top of Backbonejs to bring more control to views and a better integration between views and models/collections.

Totally integrated with browserify.

installing:
$ npm install muscle
using:
// require the libs

var Backbone = require('backbone');
var $ = Backbone.$ = require('jquery');
var Muscle = require('muscle');

// create the model and collection

var Book = Backbone.Model.extend({});
var Books = Backbone.Collection.extend({ model: Book });

// create a model view

var BookShow = Muscle.ModelView.extend({
  className: 'book-show',
  tagName: 'article',
  template: function() {
    return require('book_show_template');
  }
});

var bookShow = new BookShow({
  model: new Book({
    name: 'Backbonejs is easy',
    author: 'unknown'
  })
});

// create a collection view

var BookItem = Muscle.ModelView.extend({
  className: 'book-item',
  tagName: 'li',
  template: function() {
    return require('book_item_template');
  }
});

var BookList = Muscle.CollectionView.extend({
  tagName: 'ul',
  className: 'book-list',
  modelView: BookItem
});

var bookList = new BookList({ collection: new Books });
building:
$ npm start
testing:
$ npm test

Keywords

FAQs

Last updated on 10 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc