Permalink
Browse files

KnockoutJS: Change routing lib

  • Loading branch information...
sindresorhus committed Sep 2, 2012
1 parent 05b46df commit 0c0a6e436ee6832c432c3baf99ccb55892cbbf1c
Showing with 3 additions and 22 deletions.
  1. +1 −4 architecture-examples/knockoutjs/index.html
  2. +2 −18 architecture-examples/knockoutjs/js/app.js
@@ -57,11 +57,8 @@ <h1>todos</h1>
<p>Patches/fixes for cross-browser compat: <a href="http://twitter.com/addyosmani">Addy Osmani</a></p>
</footer>
<script src="../../assets/base.js"></script>
+ <script src="../../assets/director.min.js"></script>
<script src="js/lib/knockout.min.js"></script>
- <!--Crossroad.js -->
- <script src="../../assets/signals.min.js"></script>
- <script src="../../assets/crossroads.min.js"></script>
- <!-- / -->
<script src="js/app.js"></script>
</body>
</html>
@@ -164,22 +164,6 @@
var viewModel = new ViewModel( todos || [] );
ko.applyBindings( viewModel );
- //setup crossroads
- crossroads.addRoute('all', function() {
- viewModel.showMode('all');
- });
-
- crossroads.addRoute('active', function() {
- viewModel.showMode('active');
- });
-
- crossroads.addRoute('completed', function() {
- viewModel.showMode('completed');
- });
-
- window.onhashchange = function() {
- crossroads.parse( location.hash.replace('#', '') );
- };
-
- crossroads.parse( location.hash.replace('#', '') );
+ // set up filter routing
+ Router({ '/:filter': viewModel.showMode }).init();
}());

0 comments on commit 0c0a6e4

Please sign in to comment.