
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
backbone.fumanchu
Advanced tools
Let your handlebars grow with live template bindings for Backbone & Marionette.
Fumanchu provides a set of Handlebars Helpers and Marionette overrides that simplify otherwise tedious tasks.
This project is currently pre-alpha and not yet suitable for production use.
describe("'view' helper", function(){
beforeEach(function(){
var BeanView = Backbone.Marionette.ItemView.extend({
template: 'beans'
});
var View = Backbone.Marionette.ItemView.extend({
template: '<div>bottle and {{view "beanView"}}<div/>',
beanView: BeanView
});
view = new View();
view.render().$el.appendTo(testContainer);
});
afterEach(function(){
view = undefined;
model = undefined;
template = undefined;
testContainer.empty();
});
it('should render nested view', function(){
expect(view.$el).to.have.text('bottle and beans');
});
});
describe("'bind' helper", function(){
beforeEach(function(){
testTemplateWithModel('<div>hello, {{bind "model.name"}}</div>', {name: 'Andy'});
});
it("should render initial value properly", function(){
expect(view.$el).to.have.text('hello, Andy');
});
it("should update the value once the model has changed", function(){
model.set('name', 'Bob');
expect(view.$el).to.have.text('hello, Bob');
});
});
describe("'bound-if' helper", function(){
beforeEach(function(){
testTemplateWithModel('<div>We should {{#bound-if "model.isWeekend"}}party {{bind "model.pun"}}{{else}}work{{/bound-if}}!</div>', {
isWeekend: true,
pun: 'hard'
});
});
it("should render initial condition with nested helpers properly", function(){
expect(view.$el).to.have.text('We should party hard!');
});
it("should rerender when condition changes", function(){
model.set('isWeekend', false);
expect(view.$el).to.have.text('We should work!');
});
});
it("should render and update properly in basic case", function(){
testTemplateWithModel('<span {{bind-attr class="model.isValid?green:red"}}>message</span>', {
isValid: true
});
expect(view.$("span").attr('class')).to.equal('green');
model.set('isValid', false);
expect(view.$("span").attr('class')).to.equal('red');
});
For a description of current features, see current specs here
MIT
Released 11 January 2014
Released 9 January 2014
FAQs
Live template bindings for Backbone/Marionette.
We found that backbone.fumanchu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.