Skip to content

Instantly share code, notes, and snippets.

@verekia
Created January 20, 2016 19:49
Show Gist options
  • Save verekia/ca8e077be6fb84b3e2bf to your computer and use it in GitHub Desktop.
Save verekia/ca8e077be6fb84b3e2bf to your computer and use it in GitHub Desktop.
define(function(){
var routes = [{hash:'#list', controller:'ListController'},
{hash:'#add', controller:'AddController'}];
var defaultRoute = '#list';
var currentHash = '';
function startRouting(){
window.location.hash = window.location.hash || defaultRoute;
setInterval(hashCheck, 100);
}
return {
startRouting:startRouting
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment