Paths and Contexts
can.mustache.context
When using tags in Mustache, the key
in {{key}}
references a property on the current context object. The default context always points to the data
object initially passed to the template.
Instead of simply referencing a key matching a property on the current context object, a full path can be included instead. When a path is found, Mustache will look for a matching property using the entire path:
Additionally, the current context can be changed by using sections. Anytime a section is opened, any tags inside of it will use that object as the local context for any key lookups:
If the key used within a section is not found on the local context, Mustache will look up the stack of contexts until it finds a matching key: