Skip to content
lightweight mvc for js
JavaScript
Find file
Latest commit 6c4241f @msn0 Merge pull request #6 from msn0/uuid
Uuid

README.md

Stories in Ready Build Status

Kitty

Kitty is a lightweight (minified 1.6KB / 1KB gzipped), very simple mvc written in pure javascript.

Installation

bower install kitty --save

Basic usage

// define your model
var Todo = new Kitty.Model("Todo", {
  todo: "",
  done: false
});

// define your view
var TodoView = new Kitty.View("TodoView", {
  template: new EJS({
    url: './view/Todo.ejs'
  }),
  container: document.getElementById('todo-container'),
  tag: "div",
  events: function (){
    // do whatever you want, e.g. element.addEventListener(...)
  },
  render: function (){
    // update your view
  }
});

// create a model instance
var todo = new Todo({
  todo: "I need to do sth"
});

// create a view for your model
var todoView = new TodoView(todo);

// that's all

Example

Todo Example

Something went wrong with that request. Please try again.