Socket
Socket
Sign inDemoInstall

temple-backbone

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

temple-backbone

Adds Backbone specific handlers to Temple Mustache.


Version published
Maintainers
2
Created
Source

Temple Backbone

Adds Backbone specific handlers to Temple.

Install

Download the latest version dist/ folder and use via a script tag. The Backbone source is not included with this plugin, so it must be made available externally. Backbone depends on Underscore and, optionally, jQuery, so those should be included as well.

<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>
<script type="text/javascript" src="temple.js"></script>
<script type="text/javascript" src="temple.backbone.js"></script>

If using Browserify or Node.js, you can install via NPM and use via require("temple-backbone").

$ npm install temple-backbone

Usage

To use this plugin, call .use("backbone") on a Temple view. This will enable Backbone models and collections as a compatible data type.

view.use("backbone");
view.set(new Backbone.Model({ foo: "bar" }));
view.get("foo"); // "bar"

By default, Models are non-reactive, meaning that the view will not update as data changes. To enable, you can install and manage Dependency instances yourself, or use the built in trackModel() and trackCollection() methods.

var model = new Backbone.Model({ foo: "bar" });
Temple.Backbone.trackModel(model);
view.set(model);

Keywords

FAQs

Package last updated on 14 Oct 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc