-
-
Save jrwilliams/3a5decaeea440dbf7ae4f3654845ae8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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