JSPM

backbone-view-switcher

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q26123F
  • License MIT

A Backbone View Switcher

Package Exports

  • backbone-view-switcher

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (backbone-view-switcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

backbone-view-switcher

WORK IN PROGRESS

Build Status

places Backbone.js views into a container with an #id. can also attach a collection to an instantiated Backbone View

Installation

  • no need to do anything to use the module
  • for tests (against browsers):
    • npm install
    • npm test
  • for examples: gulp
  • to remove bundle files created by browserify: gulp clean

Usage

two-step process with collection

key benefit is reuse of putIntoMain in a Backbone Router or elsewhere

var putIntoMain = putInto('#main');
putIntoMain(PieView, Collection);

one-step process with collection

putInto('#main', PieView, Collection);

two-step process without collection

var putIntoMain = putInto('#main');
putIntoMain(SimpleView);

one-step process without collection

putInto('#main', SimpleView);

two step process with null passed as collection

var putIntoMain = putInto('#main');
putIntoMain(SimpleView, null);

one-step process with null passed as a collection

putInto('#main', SimpleView, null);