The @index context should be skipped by `../` #1554

Closed
justinbmeyer opened this Issue Mar 25, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@justinbmeyer
Contributor

justinbmeyer commented Mar 25, 2015

The following should work:

{{#each items}}
        <li can-click='{../splice @index 1}'>{{name}}</li>
{{/each}}

but it needs to be ../../splice b/c ../ hits the context created by ../

@justinbmeyer justinbmeyer added the bug label Mar 25, 2015

@justinbmeyer justinbmeyer added this to the 2.2.2 milestone Mar 25, 2015

@daffl daffl modified the milestones: 2.2.3, 2.2.2, 2.2.4, 2.3.0 Mar 31, 2015

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Sep 8, 2015

Contributor

The solution to this is to add {notContext: true} metadata anytime "@index" is added to the scope, for instance:

https://github.com/bitovi/canjs/blob/minor/view/stache/mustache_helpers.js#L34

Scope already knows to skip these things: https://github.com/bitovi/canjs/blob/minor/view/scope/scope.js#L227

Contributor

justinbmeyer commented Sep 8, 2015

The solution to this is to add {notContext: true} metadata anytime "@index" is added to the scope, for instance:

https://github.com/bitovi/canjs/blob/minor/view/stache/mustache_helpers.js#L34

Scope already knows to skip these things: https://github.com/bitovi/canjs/blob/minor/view/scope/scope.js#L227

@daffl daffl modified the milestone: 2.3.0 Oct 22, 2015

@justinbmeyer justinbmeyer added this to the 2.3.3 milestone Nov 13, 2015

justinbmeyer added a commit that referenced this issue Nov 13, 2015

justinbmeyer added a commit that referenced this issue Nov 30, 2015

@daffl daffl closed this in #2082 Nov 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment