Ember Data and Northwind OData

Can Ember-Data b3 + be used to work with such a service, http://services.odata.org/V2/Northwind/Northwind.svc . If so, can anyone provide an example on how to use it to read OData.

For example, JSBin showing a list of customers in which a customer list item can go to the orders of a clicked customer

I think this would be a great gift for developers working against different data protocols to wrap their heads around how to connect the Ember app with Ember-Data.

I did this with the help of lights, but simply could not connect it to the actual server data.

+4
source share
1

, Ember angular SPA. - Ember Set, Ember .

, , Jaydata Breeze. , / .

Jaydata Breeze propertyChanged , Ember You should use Ember Set.

, - , , "Ember", ... , Data Service .

... Ember, , , "Ember Data" Ember Set, !

, (JayData, Breeze) ...

EMBER!

( !) ember-data ! REST, IMHO WCF.

JayData, , Ember.

, :

//Instanciate the Ember APP
App = Ember.Application.create();

//Tell the APP to initialize but to wait before launching
App.deferReadiness();

//Setup your JayData Store
//Entities.EntityModel was generated by JaySvcUtil
App.myStore = new Entities.EntityModel({
    name: 'oData',
    oDataServiceHost: <YOUR_WCF_ENDPOINT_URL>
});

//Create your route and populate model data
App.IndexRoute = Ember.Route.extend({
    model: function () {
        //This passes the toArray() promise to the model
        return App.myStore.People.orderBy('it.Name').toArray();
    }
});

//When JayData Store is ready, Fire the App
App.myStore.onReady(function () {
      App.advanceReadiness();
});

Ember Route Model , JayData, . . http://emberjs.com/guides/routing/asynchronous-routing/#toc_the-router-pauses-for-promises

+3

All Articles