samedi 16 janvier 2016

How can I match my model to my adapter?

How can I match my model to my adapter?

Models/datagroup.js

App.Datagroup = DS.Model.extend({datasets: DS.hasMany('dataset')});

Models/dataset.js

App.Dataset = DS.Model.extend({
  datagroup: DS.belongsTo('datagroup'),
  key: attr('string'),
  values: DS.hasMany('value')
});

Models/datagroup.js

App.Value = DS.Model.extend({
  dataset: DS.belongsTo('dataset'),
  xValue: DS.attr('number'),
  yValue: DS.attr('number')
});

Adapters/Application.js That start by :

findAll: function() {
  return {
    "Cbio": [{
      "xValue": 1,
      "yValue": 21.969
    },{
      "xValue": 2,
      "yValue": 44.0294
    }, ...




Aucun commentaire:

Enregistrer un commentaire