Ember.js & REST API

前端 未结 4 510
Happy的楠姐
Happy的楠姐 2021-02-02 11:38

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 inter

相关标签:
4条回答
  • 2021-02-02 11:55

    Ember.js can work nicely with Ember Data. That said, there is a specific format of REST to follow. When followed, you can streamline the process of connecting API with Ember and have so much less work.

    In case you use custom REST, the place to adjust is:

    • adapter - to inform from where you like to get data
    • serializer - how data should be adjusted for custom REST API
    0 讨论(0)
  • 2021-02-02 12:00

    There is a Ember Resource library aiming REST JSON interfaces. It provides Ember.Resource class with save(), fetch() and destroy() operations that could be easily overriden. Looks like it should be more mature than Ember Data for now.

    0 讨论(0)
  • 2021-02-02 12:10

    [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 ]

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

    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.

    0 讨论(0)
  • 2021-02-02 12:11

    It seems that Ember Data is what you are looking for. It is part of emberjs organiztion in GitHub.

    0 讨论(0)
提交回复
热议问题