Git Product home page Git Product logo

closuremvc's Introduction

closuremvc is a small mvc framework built upon Google’s Closure JavaScript library.

The intent is to be lightweight and easy to read and understand. closuremvc will not be a bloated framework.

In its current form closuremvc is usable but in no way feature complete. As of 1/28/2010 a more appropriate name might be closurevc, as there is no “model” piece yet.

closuremvc provides a way to declaratively or non-declaratively build user interfaces.

This example shows how to declaratively build a simple user interface:

myapp.views.SimplePage = cmvc.ui.View.extend({
  root: { tag: 'div', id: "simplePage" },
  children: "sectionA sectionB sectionC",
  
  sectionA: cmvc.ui.View.extend({
    root: { tag: 'div', id: "firstSection", html: "This is text in sectionA." }
  }),

  sectionB: cmvc.ui.View.extend({
    root: { tag: 'div', id: "secondSection", html: "This is text in sectionB." }
  }),

  sectionC: cmvc.ui.View.extend({
    root: { tag: 'div', id: "thirdSection", html: "This is text in sectionC." }
  })
});

Then, to render the view (myapp.views.SimplePage), you’d say:

var myPage = new myapp.views.SimplePage();
myPage.render(document.body);

More to come later…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.