New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iyulab/template-binding

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iyulab/template-binding

iyulab template binding

  • 0.1.9
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

template-binding

Install

NPM

npm install @iyulab/template-binding

How to use

import { bind } from '@iyulab/template-binding';

const props = {
  innerText: "{{title}}",
  style: { "background": "{{color}}" }
};
const data = {
  title: "hello",
  color: "red"
};

bind.binding({
  target: this.header, // h1, div, DOM-element, anything...
  props: props,
  data: data
});

Use Expression Syntax

This library uses the JSONata expression syntax. See https://docs.jsonata.org/overview.html

Observable

object to an Observable object with a callback function.

import { observable } from '@iyulab/template-binding';

function onChangedValue(data: any, onChangedValue: any): any {
  console.log('onChangedValue', data, onChangedValue);
}

const data = {
  title: "hello"
};
observable(data, onChangedValue);

data.title = "world";

Log

onChangedValue {title: 'world'}title: "world"[[Prototype]]: Object {property: 'title', oldValue: 'hello', value: 'world'}

And more...

See the sample site https://template-binding.github.io/

FAQs

Package last updated on 11 Mar 2024

Did you know?

Socket

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.

Install

Related posts

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