can-stache-bindings
Advanced tools
Comparing version 4.6.3 to 4.6.4
@@ -603,3 +603,5 @@ "use strict"; | ||
"can.setValue": function setValue(newVal) { | ||
scope.set(cleanVMName(scopeProp, scope), newVal); | ||
var expr = expression.parse(cleanVMName(scopeProp, scope),{baseMethodType: "Call"}); | ||
var value = expr.value(scope); | ||
canReflect.setValue(value, newVal); | ||
}, | ||
@@ -606,0 +608,0 @@ |
{ | ||
"name": "can-stache-bindings", | ||
"version": "4.6.3", | ||
"version": "4.6.4", | ||
"description": "Default binding syntaxes for can-stache", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-stache-bindings.html", |
@@ -1290,2 +1290,30 @@ var QUnit = require('steal-qunit'); | ||
}); | ||
testIfRealDocument("Bracket Expression with :to bindings", function () { | ||
var demoContext = new DefineMap({ | ||
person: { | ||
name: 'Matt' | ||
} | ||
}); | ||
var SourceComponentVM = DefineMap.extend("SourceComponentVM", { | ||
name: { | ||
default: 'Kevin' | ||
} | ||
}); | ||
MockComponent.extend({ | ||
tag: "source-component", | ||
viewModel: SourceComponentVM, | ||
template: stache('<span>{{name}}</span>') | ||
}); | ||
var demoRenderer = stache( | ||
'<source-component name:to="person[\'name\']" />' | ||
); | ||
demoRenderer(demoContext); | ||
QUnit.equal(demoContext.person.name, 'Kevin', "source-component has correct name set"); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
177419
3879