是否有任何基因敲除页面/路由框架?

编程入门 行业动态 更新时间:2024-10-24 20:20:34
本文介绍了是否有任何基因敲除页面/路由框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

来自asp MVC3.在MVC4中,他们引入了WebAPI.能够在javascript中执行所有视图/路由代码,并且仅依赖于MVC作为API,这将是很好的.可以独立于IIS运行webapi真是太酷了!

Coming from asp 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!

话虽这么说

是否存在任何可以利用KnockoutJS的页面框架,这些框架与下面的我的模型类似:

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

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

每个路由都是viewModel的一个单独文件,一个视图将被注入到主视图中

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

我觉得基因敲除js的主要优势是不干扰您编写js的方式的能力(即,只要观察到交互对象,便可以按照您想要的方式构建对象/框架)

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)

推荐答案

Pager.js 是专门为与Knockout结合使用而构建的URL路由框架.js.确保您遍历整个演示以了解其全部功能和灵活性.恕我直言,它远远超过了PathJS和Sammy.

Pager.js is a URL routing framework built specifically for use with Knockout.js. Make sure you go through the entire Demo to see its full power and flexibility. IMHO, it far exceeds PathJS and Sammy.

更多推荐

是否有任何基因敲除页面/路由框架?

本文发布于:2023-11-06 07:02:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   基因   框架   有任何   页面

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!