Ember.HTMLBars Class


Module: ember-htmlbars

Show:

Methods

Properties

Show:

_registerHelper

(name, keyword) private

Parameters:

name String
keyword Object|Function
the keyword to add

bootstrap

(ctx) private static

Find templates stored in the head tag as script tags and make them available to Ember.CoreView in the global Ember.TEMPLATES object. This will be run as as jQuery DOM-ready callback.

Script tags with text/x-handlebars will be compiled with Ember's template compiler and are suitable for use as a view's template. Those with type text/x-raw-handlebars will be compiled with regular Handlebars and are suitable for use in views' computed properties.

Parameters:

ctx

makeBoundHelper

(fn) private

Create a bound helper. Accepts a function that receives the ordered and hash parameters from the template. If a bound property was provided in the template it will be resolved to its value and any changes to the bound property cause the helper function to be re-run with the updated values.

  • params - An array of resolved ordered parameters.
  • hash - An object containing the hash parameters.

For example:

  • With an unquoted ordered parameter:
1
  {{x-capitalize foo}}

Assuming foo was set to "bar", the bound helper would receive ["bar"] as its first argument, and an empty hash as its second.

  • With a quoted ordered parameter:
1
  {{x-capitalize "foo"}}

The bound helper would receive ["foo"] as its first argument, and an empty hash as its second.

  • With an unquoted hash parameter:
1
  {{x-repeat "foo" count=repeatCount}}

Assuming that repeatCount resolved to 2, the bound helper would receive ["foo"] as its first argument, and { count: 2 } as its second.

Parameters:

fn Function

resolveHelper

(name) Helper private

Used to lookup/resolve handlebars helpers. The lookup order is:

  • Look for a registered helper
  • If a dash exists in the name:
    • Look for a helper registed in the container
    • Use Ember.ComponentLookup to find an Ember.Component that resolves to the given name

Parameters:

name String
the name of the helper to lookup

Returns:

Helper
Show:

helpers

private
Inherited from Ember.HTMLBars but overwritten in packages/ember-htmlbars/lib/keywords.js:8