Options
inherits: can.view.Scope
Create a helper lookup node for keys. Options are where mustache helpers, partials, local tags, and other non-data objects are found.
new can.view.Options(options, [parent]) 2.1
Parameters
-
options
{Object}An object with at least one of the following properties:
helpers- Mustache helpers will be found within this object.partials- Mustache partials will be found within this object.tags- Local tag hookups will be found within this object.
If none of these properties are found, the object is assumed to be a helpers object.s
-
parent
{can.view.Options}OptionalThe parent options object. If a
keyvalue is not found in the current options object, it will then look in the parent scope.
Returns
{can.view.Options}
Returns a options instance.
Use
can.view.Optionsis rarely used directly. However, they are indirectly created in several places:helpersargument of can.viewhelpersargument.And
can.view.Optionsare provided several places:optionsproperty.optionsproperty.optionsproperty.Options works just like can.view.Scope except it contains references to local non-data values like:
When a mustache template is rendered, these can be specified like:
If no
helpers,partialsortagsproperties are found, options are assumed to be helpers. The following would pass a loalisSelectedto "people.mustache":