Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
Eser Ozvataf edited this page Jun 17, 2015 · 3 revisions

Routes handles hash-based routing on browser.

Adding a route

Usage: $l.routes.add(path, callback)

$l.routes.add('users/:name', function (name) {
  console.log(name);
});

Navigation to a route

Usage: $l.routes.go(path)

$l.routes.go('users/eserozvataf');

Adding a named route

Usage: $l.routes.addNamed(name, path, callback)

$l.routes.addNamed('user', 'users/:name', function (name) {
  console.log(name);
});

Navigation to a named route

Usage: $l.routes.goNamed(name, params)

$l.routes.goNamed('user', { name: 'eserozvataf' });
Clone this wiki locally