Code Monkey home page Code Monkey logo

ember-data-hal-adapter's Introduction

Ember Data HAL Adapter

Code Climate Gitter chat

What

A couple months back I started developing an Ember application that was driven by an hypermedia API using the application/hal+json media type. Given the lack of adapter I set out to build my own, and herein lies the result.

It isn't exactly general at the moment, since I'm only using it in this one project, so please try it out and leave me some feedback on how to improve it.

How

Bower

  • bower install ember-data-hal-adapter

Ember CLI

  • npm install --save-dev ember-data-hal-adapter

Git

  • Clone repo with git clone https://github.com/locks/ember-data-hal-adapter.git
  • Install dependencies with npm install && bower install
  • Build the library with broccoli build dist
  • Use the version in /dist more suitable for your project

ember-data-hal-adapter's People

Contributors

locks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-data-hal-adapter's Issues

store.pushPayload doesn't recognize _embedded, _links, etc.

REST is not only about client model == server model. Sometimes i need to POST something which is not exactly DS.Model, but I expect HAL back.

How can I do it with this adapter? I was trying using $.ajax to post and then store.pushPayload which probably should parse things and put them in the Store.

Is there a way to do it?

hal_adapter missing ,

Line 6 of hal_adapter.js needs a ,

4 find: function(store, type, id) {
5 return this.ajax(id, 'GET');
6 },

Fix embedded records transformation

The hack of making all the embedded records into arrays breaks belongsTo relationships in models.

Ideas:

  • Check how JSON/RESTAdapter deal with records
  • Use metadata to only parse attributes defined in the model
    • Parse metadata
    • Change extractSingle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.