-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace *variable and %special with scope
#304
Labels
Comments
This was referenced Sep 21, 2017
Closed
This was referenced Sep 28, 2017
imaustink
added a commit
to canjs/can-view-scope
that referenced
this issue
Oct 26, 2017
This was referenced Oct 26, 2017
This is done in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue represents a combination of several other issues with the goal of cleaning up some of the uglier, less "handlebars" and "javascript" bits of
can-stache
.scope
variable#with
and#each
use hash paramsMove non-contextual access to a reserved
scope
variable*variable => scope.var.variable
Move access to template variables (references scope) to
scope.var.
. Examples:%special => scope.special
Allow special keys to be looked up directly on
scope.
Examples:{{#each items}} {{%index}} {{/each}} => {{#each items}} {{scope.index}} {{/each}}
Access to other values:
scope.helpers.helperName
scope.partials.partialName
scope.tags.component-name
<can-template name="NAME">
s passed to the templatescope.templates.NAME
scope.partials.partialName
scope.view
Implementation Details
{vars: {}, helpers: {}, partials: {}, templates: {}, view: renderer, optionsScope: optionsScope}
. This object should be thetemplateContext
.partial
is looked up on thetemplateContext
, it should look in its partials, and then explore theoptionsScope
.helper
is looked up, it should look in its helpers, and then explore the options scope, and then the registered helpers.scope[can.getKeyValue]
needs special rules. It probably should first look up in the references scope, then in the "notContext" contexts, then in the normal contexts.options
arg to rendererstemplate(data, options)
to essentially set thetemplateContext
.<can-import from="drag-drop" value:merge-to="scope.events"/>
make
#with
and#each
use hash params{{#with firstName=person.first}}
{{#each items item=value num=index}}
The text was updated successfully, but these errors were encountered: