Knockout.js项目结构 [英] Knockout.js Project Structure

查看:163
本文介绍了Knockout.js项目结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找Angular.js和Knockout.js作为潜在的前端解决方案。我爱淘汰赛的教程和文档。但是,我不清楚淘汰赛如何处理模板较大的应用程序。

I have been looking at Angular.js and Knockout.js as potential front end solutions. I love Knockout's tutorials and documentation. However, it is not clear to me how Knockout handles templating larger applications.

例如在角,你会成为一个主要的模板是这样的:

For example in Angular, you would make a main template like this:

<div id="content" class="container" ng-view></div>

和那么这将通过由谐音填充,例如:

And then this would be populated by by the "partials", for example:

<p>This is a partial</p>

我的问题是,不支持淘汰赛同一个概念?似乎敲除要使用的foreach模板( http://knockoutjs.com/documentation/模板binding.html )。然而,这没有解决破HTML分解成更小的段。

My question is, does Knockout support the same concept? It appears that Knockout wants to use the "foreach" template (http://knockoutjs.com/documentation/template-binding.html). However, that does not address breaking the HTML down into smaller segments.

我在这里在正确的轨道上?有什么我的问候缺少淘汰赛的目录结构?

Am I on the right track here? Is there something I am missing in regards to Knockout's directory structure?

编辑:我已经得到了一些很好的反馈。我的理解是,淘汰赛没有内置的模板解决方案。如果这是真的,那么我可能会需要棱角分明。

I have gotten some good feedback. My understanding is that Knockout does not have a templating solution built in. If this is true, then I will probably need Angular.

推荐答案

淘汰赛不直接竞争的角度框架,它更像是对数据MVVM款式比为构建单页的应用程序完整的框架结合小型图书馆。

Knockout is not direct competition to the Angular framework, it is more like small library for data binding in MVVM style than full framework for building single page apps.

请看看迪朗达尔( http://durandaljs.com/ ),这是基于淘汰赛,并根据建议提供成分项目结构以及成功实现单页的应用程序的许多其他部分(路由器,对话框,工装,构建过程中,AMD的支持等)类似角或灰烬。

Please have a look at Durandal (http://durandaljs.com/), which is based on Knockout and provides composition based on recommended project structure and many other parts for successful implementation of single page apps (router, dialogs, tooling, build process, amd support etc...) similar to Angular or Ember.

这篇关于Knockout.js项目结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆