Skip to content

Repository files navigation

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

About

lightweight mvc for js

Resources

Stars

5 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages