GremlinJS jQuery extension
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
src
test
.babelrc
.eslintrc
.gitignore
.npmignore
LICENSE
README.md
gulpfile.js
package.json

README.md

gremlins-jquery

GREMLIN.JS jQuery mixin that supports event and element maps.

Installation

requires gremlins@1.1.x

NPM

$ npm install gremlins-jquery

make sure you have jQuery installed from npm, too.

Usage

<foo-gremlin>
    <p class="content"></p>
    <button>clicker</button>
</foo-gremlin>
const gremlins = require('gremlins');
const gremlinsJquery = require('gremlins-jquery');
  
gremlins.create('foo-gremlin', {
    mixins: [gremlinsJquery],
    elements: {
      '.content': '$content'
    },
    events: {
      'click button': 'onClick'
    },
    created() {
      this.$el.addClass('ready');
    },
    onClick() {
      this.$content.text('foo is here!');
    }
});