paperclip.BaseBlockBinding


paperclip.blockBinding(name, blockBindingClass)

Registers a new block binding class. Block bindings allow you to modify how templates behave. Some examples include the {{#if:condition}}{{/}}, and {{html:content}}.

BaseBlockBinding(options)

Base class to extend when creating custom block bindings. Here's an example for an {{#each:source}}{{/}} binding:

override bind(context)

Called when the block is added, and bound to the DOM. This is where you initialize your binding. Be sure to call paperclip.BaseBlockBinding.prototype.bind.call(this, context) if you override. this method

override unbind()

Called when the block is removed from the DOM. This is a cleanup method.

override _onChange(context)

Called whenever the properties change for the block binding. These properties are defined in the template. Here's the syntax:

{{blockName: blockProperties }}

nodeFactory

the node factory for creating elements. Use this to make your block binding compatible with the NodeJS and the browser.

application

the application

clip

the data binding

scriptName

the name registered for the block binding

section

the section which contains all the elements

contentTemplate

the content template - this might be undefined if your block binding doesn't have {{#block:properties}}content{{/}}.

childBlockTemplate

The child block template. Used in the conditional block.