Ember.js& REST API [英] Ember.js & REST API

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

问题描述

从Ember.js的所有各种示例中,我无法确定Ember.js中是否有一个默认方法执行REST AJAX调用。许多示例为CRUD操作构建自己的接口。我甚至试图筛选代码以查找任何AJAX调用的引用,但没有提出任何内容。

From all the various examples of Ember.js, I have not been able to figure out if there is a default method in Ember.js to do REST AJAX calls. Many examples build their own interfaces for CRUD operations. I even tried to sift through the code to find any reference to AJAX calls but came up with nothing.

所以,我的问题是,是否有一个REST API的默认实现在Ember.js。如果是,我该如何使用?另外,对于特定应用程序,我想要构建自定义CRUD方法,在哪里可以将它们插入到Ember.js中?

So, my question is, is there a default implementation of REST API in Ember.js. If yes, how do I use it? Also if, for a specific application, I want to build custom CRUD methods, where do I plug these into Ember.js?

推荐答案

[2014-02-18:已弃用 - 我不再支持ember休息,因为它过于简单,并且建议对大多数ember项目使用ember数据。查看 Ember指南以了解ember数据以及示例项目]

[2014-02-18: Deprecated - I no longer support ember-rest because it is overly simplistic, and would recommend using ember-data for most ember projects. Check out the Ember guides for an overview of ember-data as well as this example project ]

在学习Ember的同时,我决定创建一个非常简单的 Ember REST 库。我也写了一个例子 Rails CRUD应用程序

While learning Ember, I decided to create a very simple Ember REST library. I also wrote an example Rails CRUD app.

我的目标是保持这个项目尽可能的简单,同时还包括错误处理和验证。 Ember REST肯定比Ember Data和Ember Resource更精简,希望您能发现代码的注释和可访问性。

My goals were to keep this project as simple as possible, while still including error handling and validation. Ember REST is certainly much leaner than Ember Data and Ember Resource, and I hope you'll find the code well commented and accessible.

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

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