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

Add "./" to mustache to denote selecting a property from current scope #874

Merged
merged 1 commit into from Apr 7, 2014

Conversation

Projects
None yet
3 participants
@alexisabril
Contributor

alexisabril commented Apr 7, 2014

Closes #873

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Apr 7, 2014

Contributor

Also closes #645 and #723

Contributor

daffl commented Apr 7, 2014

Also closes #645 and #723

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Apr 7, 2014

Contributor

We should document that somewhere.

Contributor

daffl commented Apr 7, 2014

We should document that somewhere.

daffl added a commit that referenced this pull request Apr 7, 2014

Merge pull request #874 from bitovi/current-scope
Add "./" to mustache to denote selecting a property from current scope

@daffl daffl merged commit 1ae49ea into minor Apr 7, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@daffl daffl deleted the current-scope branch Apr 7, 2014

// check if we should only look within current scope
if(attr.substr(0, 2) === './') {
// set flag to halt lookup from walking up scope
this._stopLookup = true;

This comment has been minimized.

@justinbmeyer

justinbmeyer Apr 11, 2014

Contributor

This is a less than ideal implementation. We should not be setting temporary properties like this on a scope. Why not set a stopLookup variable to true and change attr = attr.substr(2)?

@justinbmeyer

justinbmeyer Apr 11, 2014

Contributor

This is a less than ideal implementation. We should not be setting temporary properties like this on a scope. Why not set a stopLookup variable to true and change attr = attr.substr(2)?

@daffl daffl added this to the 2.1.0 milestone Apr 11, 2014

@@ -345,4 +345,21 @@ steal("can/view/scope", "can/route", "can/test", function () {
.compute(), "baz", "static prop");
});
test('Scope lookup restricted to current scope with ./', function() {

This comment has been minimized.

@justinbmeyer

justinbmeyer Apr 27, 2014

Contributor

This doesn't actually test bubbling. 2 scopes are needed to be created. Not a Child extending from it's parent.

Also, there should be a test in mustache or stache verifying this.

@justinbmeyer

justinbmeyer Apr 27, 2014

Contributor

This doesn't actually test bubbling. 2 scopes are needed to be created. Not a Child extending from it's parent.

Also, there should be a test in mustache or stache verifying this.

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