Skip to content

ryandao/skull.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

skull.js

Lightweight Javascript MVC framework

Sample usage

App = Skull.Application.create();

App.router.define({
  '/movies': 'App.MoviesIndexRoute'
});

App.MoviesIndexRoute = Skull.Route.extend({
  controller: App.Router.MoviesIndexController,
  view: App.Router.MoviesIndexView
  
  // Custom setup for the route
  setup: function() { }
});

App.MoviesIndexController = Skull.Controller.extend({
  initialize: function() {
    this.set('movies', App.Movie.find());
  }
  
  movieClick: function(movie) {

  }
});

App.MoviesIndexView = Skull.View.extend({
  templateName: 'movies_index',
  rootEl: '#movie-list'
})

// movies_index.handlebars
{{#each movie in controller.movies}}
  // Display movies
  <a {{action 'movieClick' movie}}>click</a>
{{/each}}

// When the route is called, create an instance of route, controller, and view

App.Movie = Skull.Model.extend({
  title: 'string',
  rating: 'number'
})

Architecture overview

image

About

Extensible and minimalistic Javascript framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published