什么是客户端MVC以及如何在JavaScript中实现? [英] What is client side MVC and how is it implemented in JavaScript?

查看:311
本文介绍了什么是客户端MVC以及如何在JavaScript中实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近经历了许多解释单页应用的文章。但是我对这个架构非常困惑,或者说它是如何工作的。

Recently gone through many articles explaining single page application. But i am very much confused about the architecture or rather how it works.


  1. 有一些新的称为客户端MVC的实现通过使用JavaScript。直到现在我已经看到了服务器端MVC架构。什么是客户端MVC?

  1. There is some thing new called client side MVC implemented by using javascript. Till now i had seen server side MVC architecture. What is this client side MVC?

客户端MVC文件在哪里托管。它是否与类似于典型Web应用程序的服务器文件一起托管。

Where does the client side MVC files are hosted. Is it hosted along with server files similar to typical web application.

服务器端java脚本如node.js的作用是什么。

What is the role of server side java script like node.js.

从头到尾是什么流程。


推荐答案

客户端MVC意味着MVC框架完全在客户端构建。因此服务器只向应用程序提供数据。数据与模型的绑定发生在客户端。

Client side MVC means that a MVC framework is built entirely on the client side. So the server only delivers data to the application. The binding of the data to the models happens client side.

实现此原则的框架示例是 AngularJs
另一个是 Ember

An example of a framework that implements this principle is AngularJs Another one is Ember.

服务器端的节点与客户端MVC无关。传递给webapp的数据可以由任何能够做到这一点的技术提供。

Node on the server side has nothing to do with client side MVC. The data delivered to the webapp could be delivered by any technology capable of doing that.

Nodejs通常用于运行客户端开发工具并运行测试。例如, AngularJs教程附带的开发服务器是在节点上构建的。

Nodejs is often used to run client side development tools and run tests. For example, the development server that comes with the AngularJs tutorial is build on node.

这篇关于什么是客户端MVC以及如何在JavaScript中实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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