Alex Rivera | Logout

Are there any knockoutjs page/routing frameworks?

Asked 2012-03-14T15:38:28.663
42

Coming from asp.net MVC 3. In MVC4 they introduced WebAPI's. It would be nice to be able to do all view/routes code in javascript and just rely on MVC for API. Heck it's really cool that webapi's can be run independent of IIS!

That being said:

Are there any page frameworks that can leverage KnockoutJS which are similar to my mock-up below:

Framework.RegisterRoutes(..,mainViewModel);//sets the CurrentViewModel?

Each route being a separate file of a viewModel, and a view to be injected into the master view

var mainviewModel= function(){
   var self = this;
   self.CurrentViewModel = ko.observable();
   ...
   return self;
}

<div id="mainPageContent" data-bind:'html:CurrentViewModel.Render'>
</div>

I know that a lot of this can be achieved by self, but not sure how to achieve the register routes/ loading separate files

I feel like knockoutjs's main strengths is the ability to not intrude into the way you code js (ie build an object/framework how you want so long as the interacting objects are observable)

Edit
Report

1 Answer

3

I've used PathJs with some success, there is also Sammy which is more of a framework. Neither of these are KO specific.

A more heavyweight but KO optimized solution would be Knockback.

Hope this helps.

answered 2012-03-14T17:01:47.597

Your Answer