Skip to content
A javascript framework view layer that functions similar to backbone.
Branch: master
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.
.idea
README.md
element.js

README.md

Element

Element is a very rudimentary Backbone like view layer. It allows the user to create a view, define events and perform actions on that view. Element relies on vanilla javascript to interact with the dom.

example:

var element = require('./element');

var hello = element({

    events: {
        'click .hello': 'hello'
    }

    initialize: function () {
        this.render();
    }

    makeHello: function () {
        this.hello = document.createElement('div');
        this.el.appendChild(hello);
    }

    render: function () {
        this.makeHello();
    }

    hello: function (e) {
        this.hello.innerText = 'hello';
    }

});


new Hello({el: document.getElementsByTagName('body')})
You can’t perform that action at this time.