Create a gist now

Instantly share code, notes, and snippets.

@jrwilliams /mithril.html Secret
Last active Jan 31, 2017

Embed
What would you like to do?
<html>
<head>
<title>Mithril</title>
</head>
<body>
<script src="http://unpkg.com/mithril/mithril.js"></script>
<script>
var root = document.body;
var Home = {
view: () => {
return m('a', { href: '#!/List' }, 'List');
}
};
var TodoList = {
view: () => {
return m('a', { href: '#!/Home' }, 'Home');
}
};
// Works as expected
m.route(root, '/Home', {
'/Home': Home,
'/List': TodoList
});
// Crashes Chrome
// m.route(root, '/home', {
// '/Home': Home,
// '/List': TodoList
// });
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment