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)
question from:
https://stackoverflow.com/questions/9705078/are-there-any-knockoutjs-page-routing-frameworks 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…