javascript - Ember serializers & adapters not loading -
i have ember-cli app using ember 1.11.1, ember-data 1.0.0-beta.16.1 & ember-cli 0.2.1
i have serializer in app/serializers/role.js generated via ember g serializer role
import ds 'ember-data'; export default ds.restserializer.extend({});
and have adapter in app/adapters/application.js:
import ds 'ember-data'; export default ds.restadapter.extend({namespace: 'api/1'});
when load app, chrome ember inspector shows no sign of serializer or adapter in container section.
the correct code appear in /assets/frontend/frontend.js
when view source in browser:
define('frontend/serializers/role', ['exports', 'ember-data'], function (exports, ds) { 'use strict'; exports['default'] = ds['default'].restserializer.extend({}); }); define('frontend/adapters/application', ['exports', 'ember-data'], function (exports, ds) { 'use strict'; exports['default'] = ds['default'].restadapter.extend({ namespace: "api/1" }); });
the ember application boots without errors except when try add , use serializer, nothing works because it's not loaded , doesn't appear in ember container - when check application.registry._defaultcontainer.cache
via console.
i have simple ember-cli app show same adapter , serializer in container can't figure out why , other app doesn't.
any idea why might be? it's driving me nuts.
serializers , adapters no longer singleton. assume looking @ content of container tab in inspector, shows singleton objects.
when
when try add , use serializer, nothing works
how do this? way access them via store.
basically how works store (store:main) responsible returning adapter , serializer when asked. first time it's asked created instance , every subsequent request returns same single instance. reason aren't singleton because single store instance needs maintain own adapters , serializers - if have 2 stores need able create 2 'person' adapters example.
this ember forum discussion might bit. this pull request implementation.