Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
can-stache-bindings
Advanced tools
Default binding syntaxes for can-stache.
{(child-prop)}="key"
{($child-prop)}="key"
{child-prop}="key"
{$child-prop}="key"
{^child-prop}="key"
{^$child-prop}="key"
($DOM_EVENT)='CALL_EXPRESSION'
(VIEW_MODEL_EVENT)='CALL_EXPRESSION'
*ref-prop
{(child-prop)}="key"
Two-way binds childProp
in the [can-component::viewModel viewModel] to
[can-stache.key] in the parent [can-view-scope scope]. If childProp
is updated key
will be updated
and vice-versa.
<my-component {(some-prop)}="value"/>
When setting up the binding:
childProp
is undefined
, key
will be set to childProp
.key
is undefined
, childProp
will be set to key
.childProp
and key
are defined, key
will be set to childProp
.child-prop {String}
:
The name of the property of the viewModel to two-way bind.
key {String}
:
The name of the property to two-way bind in the parent scope.
{($child-prop)}="key"
Two-way binds the element's childProp
property or attribute to
[can-stache.key] in the parent [can-view-scope scope]. If childProp
is updated key
will be updated
and vice-versa.
<input {($value)}="name"/>
child-prop {String}
:
The name of the element's property or attribute to two-way bind.
key {String}
:
The name of the property to two-way bind in the parent scope.
{child-prop}="key"
Imports [can-stache.key] in the [can-view-scope scope] to childProp
in [can-component::viewModel viewModel]. It also updates childProp
with the value of key
when key
changes.
<my-component {some-prop}="value"/>
child-prop {String}
:
The name of the property to set in the
component's viewmodel.
key {can-stache.expressions}
:
A KeyLookup or Call expression whose value
is used to set as childProp
.
{$child-prop}="key"
Imports [can-stache.key] in the [can-view-scope scope] to childProp
property or attribute on the element.
<input {$value}="name"/>
This signature works, but the following should be used instead:
<input value="{{name}}"/>
{^child-prop}="key"
Exports childProp
in the [can-component::viewModel viewModel] to [can-stache.key] in the parent [can-view-scope scope]. It also updates
key
with the value of childProp
when childProp
changes.
<my-component {^some-prop}="value"/>
child-prop {String}
:
The name of the property to export from the
child components viewmodel. Use {^this}
or {^.}
to export the entire viewModel.
key {String}
:
The name of the property to set in the parent scope.
{^$child-prop}="key"
Exports the element's childProp
property or attribute to [can-stache.key] in the parent [can-view-scope scope]. It also updates
key
with the value of childProp
when childProp
changes.
<input {^$value}="name"/>
child-prop {String}
:
The name of the element's property or attribute to export.
key {String}
:
The name of the property to set in the parent scope.
($DOM_EVENT)='CALL_EXPRESSION'
Specify a callback function to be called on a particular DOM event.
<div ($click)="doSomething()"/>
DOM_EVENT {String}
:
A DOM event name like "click". jQuery custom events can also
be given.
CALL_EXPRESSION {can-stache.expressions}
:
A call expression like method(key)
that is called when the DOM_EVENT
is fired. The following key values are also supported:
%element
- The element the event happened upon.$element
- The [can.$] wrapped element the event happened upon.%event
- The event object.%viewModel
- If the element is a [can.Component], the component's [can.Component::viewModel viewModel].%context
- The current context.%scope
- The current [can.view.Scope].(VIEW_MODEL_EVENT)='CALL_EXPRESSION'
Specify a callback function to be called on a particular [can-component::viewModel viewModel] event.
<my-component (show)="doSomething()"/>
DOM_EVENT {String}
:
A DOM event name like "click". jQuery custom events can also
be given.
CALL_EXPRESSION {can-stache.expressions}
:
A call expression like method(key)
that is called when the DOM_EVENT
is fired. The following key values are also supported:
%element
- The element the event happened upon.
$element
- The [can.$] wrapped element the event happened upon.
%event
- The event object.
%viewModel
- If the element is a [can-component], the component's [can-component::viewModel viewModel].
%context
- The current context.
%scope
- The current [can-view-scope].
*ref-prop
A shorthand for exporting an element's viewModel to the reference scope.
ref-prop {String}
:
The name of the property to set in the template's 'references' scope.
To make a build of the distributables into dist/
in the cloned repository run
npm install
node build
Tests can run in the browser by opening a webserver and visiting the test.html
page.
Automated tests that run the tests from the command line in Firefox can be run with
npm test
FAQs
Default binding syntaxes for can-stache
The npm package can-stache-bindings receives a total of 1,960 weekly downloads. As such, can-stache-bindings popularity was classified as popular.
We found that can-stache-bindings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.