samedi 23 janvier 2016

rest adapter not working in ember

i am trying to connect ember with sails , but it seems error in rast adsastrd

import DS from 'ember-data';

import Ember from 'ember';
import appConf from '../models/app-conf'

export default DS.RESTAdapter.extend({
        // authorizer: 'authorizer:oauth2',
        namespace: 'api/v1',
        host: localhost:1337,
        // session: Ember.inject.service('session'),
        // headers: Ember.computed('session.isAuthenticated', function () {
        //      return {
        //              'authenticated': this.get('session.isAuthenticated')
        //      };
        // }),
        shouldReloadAll: function () { return true; },
        shouldBackgroundReloadRecord: function () { return false; },
        modelType: null,
    pathForType: function (type) {
        if (Ember.isNone(this.get("modelType")))
            throw this + ".modelType is not set!!!";
                return this.get("modelType");

        }
});

whats wrong with ths code, thank you in advance..




Aucun commentaire:

Enregistrer un commentaire