Xm4s / Router.js

Micro Routing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Router.js

Routing Micro Framework ( < 1KB minified ) without dependencies

Usage:

Router.init([
  {controller: 'test', route: '/test/:name/:surname'},
  {controller: 'home', route: ''}
]).onChange(function(controller, params) {
	
});

Follow the example, with url '#/test/Alberto/Sarullo' the event will incapsulate two parameters:

controller will be: 'test'
params will be: {
  'name':    'Alberto', 
  'surname': 'Sarullo'
 }

About

Micro Routing


Languages

Language:JavaScript 100.0%