Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Ampersand.js】介绍 #13

Open
dongtong opened this issue May 5, 2016 · 0 comments
Open

【Ampersand.js】介绍 #13

dongtong opened this issue May 5, 2016 · 0 comments

Comments

@dongtong
Copy link
Owner

dongtong commented May 5, 2016

&yet发布了用于构建JavaScript应用的“不像框架”的框架Ampersand.js。

Ampersand.js 是一个高度模块化,松耦合,用于构建先进的 JavaScript 应用程序的框架。通过良好定义的方法,结合了一系列微小的 CommonJS 模块。条理清晰,没有多余的冗余代码。

其灵感主要来自Backbone.js,但与Backbone.js的主要不同之处在于,Ampersand.js更加模块化,并添加了更多的(完全可选的)特性。

Ampersand.js中最重要的模块(它们的文档或许也是最完善的)包括:

  • ampersand-state:与Backbone.js的模型类似,但它们没有与RESTful服务进行任何形式的绑定。这一功能被添加在ampersand-model中。开发者可以对状态类中的属性赋予类型,并在赋值的时候检查这些类型。
  • ampersand-model:通过添加与服务器交互,来处理加载、保存和对象同步的方法,对ampersand-state进行扩展。
  • ampersand-collection:除了不提供加载或保存集合的方法外,它与Backbone.js的集合等价。
  • ampersand-rest-collection:扩展了ampersand-collection,增加了将某个集合加载并保存到某个RESTful服务的方法。
  • ampersand-view:类似于Backbone.js的视图,它是一套用于将模型绑定到DOM节点的机制。
  • ampersand-form-view:用于便捷地使用数据绑定来构建一致的表单的模块。
  • ampersand-router:用于更新浏览器中的URL的模型,而且它的更新并不会实际加载页面。该模块中的许多代码来自Backbone.js,并做了一些扩展。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant