Skip to content
This repository has been archived by the owner on Aug 19, 2019. It is now read-only.
/ puppet-js Public archive

Custom Element to bind server-side view models with HTML nodes (HTML Templates/Web Components/AngularJs Apps) using PuppetJS communication (JSON-Patch, HTTP PATCH/WebSocket)

License

Notifications You must be signed in to change notification settings

Palindrom/puppet-js

Repository files navigation

<puppet-js>

Custom Element to bind server-side view models with HTML nodes (HTML Templates/Web Components/AngularJs Apps) using PuppetJS communication (JSON-Patch)

Demo

Example with Polymer app

Install

Install the component using Bower:

$ bower install puppet-js --save

Or download as ZIP.

Usage

  1. Import Web Components' polyfill:

    <script src="bower_components/platform/platform.js"></script>
  2. Import Custom Element:

    <link rel="import" href="bower_components/puppet-js/src/puppet-js.html">
  3. Start using it!

    <puppet-js ref="nodeToBind"></puppet-js>

Attributes

Attribute Options Default Description
ref String (required) Id or object reference to DOM Element to bind with server
serverURL String window.location.href Data (view model) server URL
ignoreAdd String undefined Regular expression with local properties to ignore (see PuppetJS.ignoreAdd). Should be given in string format, like "_.+".
useWebSocket String false Upgrade communication protocol to WebSocket (see PuppetJS.useWebSocket)

Properties, Methods, Events

<puppet-js> inherits from Puppet so take a look at PuppetJs API.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

For detailed changelog, check Releases.

License

MIT

About

Custom Element to bind server-side view models with HTML nodes (HTML Templates/Web Components/AngularJs Apps) using PuppetJS communication (JSON-Patch, HTTP PATCH/WebSocket)

Resources

License

Stars

Watchers

Forks

Packages

No packages published