Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-stache-bindings

Package Overview
Dependencies
Maintainers
15
Versions
219
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-stache-bindings - npm Package Compare versions

Comparing version 4.10.1 to 4.10.2

.vscode/settings.json

8

can-stache-bindings.js

@@ -18,3 +18,3 @@ "use strict";

var canViewModel = require('can-view-model');
var observeReader = require('can-stache-key');
var stacheKey = require('can-stache-key');
var ObservationRecorder = require('can-observation-recorder');

@@ -767,7 +767,7 @@ var SimpleObservable = require('can-simple-observable');

var isBoundToContext = vmName === "." || vmName === "this";
var keysToRead = isBoundToContext ? [] : observeReader.reads(vmName);
var keysToRead = isBoundToContext ? [] : stacheKey.reads(vmName);
function getViewModelProperty() {
var viewModel = bindingContext.viewModel;
return observeReader.read(viewModel, keysToRead, {}).value;
return stacheKey.read(viewModel, keysToRead, {}).value;
}

@@ -806,3 +806,3 @@ //!steal-remove-start

} else {
canReflect.setKeyValue(viewModel, setName, newVal);
stacheKey.write(viewModel, keysToRead, newVal);
}

@@ -809,0 +809,0 @@ }

{
"name": "can-stache-bindings",
"version": "4.10.1",
"version": "4.10.2",
"description": "Default binding syntaxes for can-stache",

@@ -65,7 +65,7 @@ "homepage": "https://canjs.com/doc/can-stache-bindings.html",

"jshint": "^2.9.1",
"steal": "^1.2.9",
"steal": "^2.2.1",
"steal-qunit": "^1.0.1",
"steal-tools": "^1.1.2",
"testee": "^0.7.0"
"steal-tools": "^2.2.1",
"testee": "^0.9.0"
}
}

@@ -824,2 +824,41 @@ var QUnit = require('steal-qunit');

});
QUnit.test("nested props with two way binding", function() {
var nestedValue = new SimpleMap({
first: 'Matt'
});
var childVM = new SimpleMap({
name: nestedValue
});
MockComponent.extend({
tag: "my-child",
viewModel: childVM,
template: stache('<input value:bind="name.first" />')
});
var parentVM = new SimpleMap({
name: 'Justin'
});
MockComponent.extend({
tag: "my-parent",
viewModel: parentVM,
template: stache('<my-child name.first:bind="name" /><input value:bind="name" />')
});
var template = stache("<my-parent />")();
var parentInput = template.childNodes.item(0).childNodes.item(1);
var childInput = template.childNodes.item(0).childNodes.item(0).childNodes.item(0);
parentInput.value = 'updated';
domEvents.dispatch(parentInput, 'change');
QUnit.equal(parentVM.get('name'), 'updated', 'parent vm has correct value');
QUnit.equal(nestedValue.get('first'), 'updated', 'child vm has correct value');
childInput.value = 'child-updated';
domEvents.dispatch(childInput, 'change');
QUnit.equal(parentVM.get('name'), 'child-updated', 'parent vm has correct value');
QUnit.equal(nestedValue.get('first'), 'child-updated', 'child vm has correct value');
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc