ember-data

What could be reason of the error 'Maximum call stack size exceeded' inside Ember Data?

五迷三道 提交于 2021-01-27 12:56:33
问题 After Ember release new version 3.6.0 I started to get the error in console: rsvp.js:24 Uncaught RangeError: Maximum call stack size exceeded at WeakMap.get () at getCacheFor (metal.js:25) at ComputedProperty.get (metal.js:2350) at Array.CPGETTER_FUNCTION [as []] (metal.js:752) at Function.jQuery.extend.jQuery.fn.extend (jquery.js:261) at Function.jQuery.extend.jQuery.fn.extend (jquery.js:282) at Function.jQuery.extend.jQuery.fn.extend (jquery.js:282) at Function.jQuery.extend.jQuery.fn

How to access the Ember Data Store from the console?

一曲冷凌霜 提交于 2020-05-25 17:14:10
问题 In Ember 2+, does anyone know how to get a reference to the Ember Store in order to troubleshoot Model mapping in the javascript console? It was possible through App.__container__.lookup in Ember 1, but this doesn't exist anymore, and it's bloody hard to find documentation on this. Thanks 回答1: If you look in your package.json , you should see a ember-export-application-global package that's installed by default (if not, install it). This will export your application not to the global App

How to access the Ember Data Store from the console?

泪湿孤枕 提交于 2020-05-25 17:13:30
问题 In Ember 2+, does anyone know how to get a reference to the Ember Store in order to troubleshoot Model mapping in the javascript console? It was possible through App.__container__.lookup in Ember 1, but this doesn't exist anymore, and it's bloody hard to find documentation on this. Thanks 回答1: If you look in your package.json , you should see a ember-export-application-global package that's installed by default (if not, install it). This will export your application not to the global App

How to access the Ember Data Store from the console?

天涯浪子 提交于 2020-05-25 17:13:26
问题 In Ember 2+, does anyone know how to get a reference to the Ember Store in order to troubleshoot Model mapping in the javascript console? It was possible through App.__container__.lookup in Ember 1, but this doesn't exist anymore, and it's bloody hard to find documentation on this. Thanks 回答1: If you look in your package.json , you should see a ember-export-application-global package that's installed by default (if not, install it). This will export your application not to the global App

Error evaluating App.Product.findQuery

ε祈祈猫儿з 提交于 2020-03-05 07:59:10
问题 I'm trying to get data from an API like this: App.Store = DS.Store.extend({ revision: 12, adapter: DS.RESTAdapter.create({ host: 'http://api.my-api/v1/products(name=my-name)' }) }); App.Product = DS.Model.extend({ name: DS.attr('string') }); App.ApplicationRoute = Ember.Route.extend({ model: function () { return App.Product.findQuery({show: 'sku,name', format: 'json', apiKey: 'MyApIkEy123'}); } }); The error I get in the console is: Error while processing route: index undefined is not a

Passing parameters to save()

南笙酒味 提交于 2020-02-27 23:27:39
问题 Is it possible to pass parameters like this? I need to pass some information that is not part of the model itself. myModel.save({site : 23}) 回答1: It is possible if you: add a 'volatile' attribute to your model, define a custom model serializer, and override its serializeIntoHash method. For instance: App.Model = DS.Model.extend({ //... site: DS.attr('number', { serialize: false }) }); App.ModelSerializer = DS.RESTSerializer.extend({ serializeIntoHash: function(hash, type, record, options) {

Passing parameters to save()

允我心安 提交于 2020-02-27 23:26:46
问题 Is it possible to pass parameters like this? I need to pass some information that is not part of the model itself. myModel.save({site : 23}) 回答1: It is possible if you: add a 'volatile' attribute to your model, define a custom model serializer, and override its serializeIntoHash method. For instance: App.Model = DS.Model.extend({ //... site: DS.attr('number', { serialize: false }) }); App.ModelSerializer = DS.RESTSerializer.extend({ serializeIntoHash: function(hash, type, record, options) {

Ember data not loading belongsto relationship using fixtures

最后都变了- 提交于 2020-02-22 06:12:24
问题 I am working on a very basic ember app , but I can't seem to get it to display the belongsto model. My user model: News.User = DS.Model.extend({ username: DS.attr('string'), items: DS.hasMany('News.Item') }); News.User.FIXTURES = [ { "id": 1, "username": "Bobba_Fett", "items": [1,2] }] My item model: 'use strict'; News.Item = DS.Model.extend({ title: DS.attr('string'), url: DS.attr('string'), domain: DS.attr('string'), points: DS.attr('number'), comments: DS.hasMany('News.Comment'), user: DS