Skip to content
Fix Code Error

Tag: ember-data

Ember – Object has no method ‘map’

April 29, 2021 by Code Error

Posted By: Anonymous I am going through the ember.js guides to learn Ember, and I am using the latest builds of ember.js, ember-data.js, and handlebars.js. I am able to successfully set up a basic nav that switches between views. However, upon trying to integrate a model with a {{#each model}}, I get an error message: …

Continue Reading

Ember-Data: My custom `serializeIntoHash` is returning an empty hash?

April 29, 2021 by Code Error

Posted By: Anonymous By default when the RESTAdapter sends a request to the server to POST data, it sends the model’s typeKey as the root of the hash: typeKey: { data } but my server wants a ‘rootless’ hash: { data } I discovered that this is the method to overwrite, but something I am …

Continue Reading

how to handle HTTP errors in emberJs while using ember-data with RESTAdapters?

April 29, 2021 by Code Error

Posted By: Anonymous I have a route /products. In App.ProductsRoute, I am using a setupController hook to assign list of products fetched from server to local App.Product objects. I am setting the model in setupController hook as : self_controller.set(‘model’, self_controller.store.find(‘product’)); This works well when HTTP status is 200. But when server returns some HTTP error …

Continue Reading

Ember get JSON from non REST url

April 29, 2021 by Code Error

Posted By: Anonymous I have to fetch data from a URL that has query params rather than a RESTful like structure and then return the results in a model to use in a template. An example of the request URL is http://test.net/client/query?owner_uid=OWNER&format=json&per_page=400&r=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,28,29,30,31,32&m5=1&m6=0&user_token=TOKEN What the best way to do this with Ember. Should I be using …

Continue Reading

How to get the status code from DS.InvalidError and DS.AdapterError?

April 29, 2021 by Code Error

Posted By: Anonymous Currently in the process of upgrading quite a large EmberJS app all the way from 1.7 to 1.13 (and then 2.0 later). We’re pretty much there now. We handle errors from the server differently depending on the HTTP status code. Our current code goes a little like this… model.save().then( // Success function() …

Continue Reading

`needs` not waiting for data to be returned before rendering template

April 29, 2021 by Code Error

Posted By: Anonymous I am trying to implement a controller needing another (CampaignsNew needing AppsIndex), which looks like App.CampaignsNewController = Ember.Controller.extend({ needs: [‘appsIndex’] }); And in my CampaignsNew template I am showing it via {{#if controllers.appsIndex.content.isUpdating}} {{view App.SpinnerView}} {{else}} {{#each controllers.appsIndex.content}} {{name}} {{/each}} {{/if}} However controllers.appsIndex.content.isUpdating is never true. I.e. it attempts to show the …

Continue Reading

Ember routes specifying a different root url

April 29, 2021 by Code Error

Posted By: Anonymous I’ve an application running on my wamp server. The directory structure looks like this Wamp/www/applicationliveshere However I’ve an ember application within the same directory and it’s structure looks like this Wamp/www/emberApp/applicationliveshere I’ve set up my php project using REST so that I can access the my data using eg. Get http:localhost/emberApp/videos will …

Continue Reading

How do I upgrade revision in emberjs DS.Store

April 29, 2021 by Code Error

Posted By: Anonymous I am new to emberJS and I was wondering one thing about the DS.Store revision value. From the documentation and Katz’s peepcode video (which I highly recommend), you get a nice little error message in the console when the revision is too high, for instance: App.store = DS.Store.create({ revision: 11, adapter: DS.RESTAdapter.create({ …

Continue Reading

Manipulating Ember Model in Component

April 29, 2021 by Code Error

Posted By: Anonymous To control the layout of a page, I’m attempting to pass a model to an Ember component and splicing it into groups. I can’t figure out how without have to access content._data and essentially recreating the model. The rough code: parentRoute.js export default Ember.Route.extend({ model() { return this.store.findAll(‘item’); } }); parentRoute.hbs {{ …

Continue Reading

Ember Data list of Strings/Numbers

April 29, 2021 by Code Error

Posted By: Anonymous how to declare model in Ember data that has list of parametrs (strings, numbers)? Ember data provides only 3 methods: DS.attr, DS.hasMany, DS.belongsTo. I could declare it as custom Parameter Model that has single parameter name. But this seems redundant. DS.hasMany(‘string’) is not working, exception is thrown that there is no model …

Continue Reading

can not delete record using ember-data

April 29, 2021 by Code Error

Posted By: Anonymous i cannot delete record using RESTAdapter. Model: Blog.Post = DS.Model.extend({ title:DS.attr(‘string’), body:DS.attr(‘string’), date:DS.attr(‘date’) }); ApplicationAdapter: Blog.ApplicationAdapter = DS.RESTAdapter.extend({ host:’http://localhost:8080′, namespace: ‘api’, serializer: Blog.ApplicationSerializer }); I have a button with action: <button {{action deletePost this target=”controller”}}>Delete post</button> And controller: Blog.PostController = Ember.ObjectController.extend({ actions:{ deletePost: function () { var post = this.get(‘model’); post.deleteRecord(); post.save(); …

Continue Reading

Ember.js Controller Does not work

April 29, 2021 by Code Error

Posted By: Anonymous I can’t access to my array controller variables. I have this simple application for example: App.js App = Ember.Application.create(); App.ApplicationAdapter = DS.FixtureAdapter.extend(); App.Router.map(function() { this.route(‘hello’); }); App.IndexRoute = Ember.Route.extend({ redirect: function() { this.transitionTo(‘hello’); } }); App.HelloController = Ember.ArrayController.extend({ name: ‘tom’ }); App.HelloRoute = Ember.Route.extend({ model: function() { return this.store.find(‘hello’); } }); App.Hello …

Continue Reading

Ember-Data: RESTAdapter: It is possible to sideload an object list inside a sideloaded object?

April 29, 2021 by Code Error

Posted By: Anonymous Hello I am working with emberjs and ember-data and Im really new to javascript. I’m following this guide from ember website: http://emberjs.com/guides/models/the-rest-adapter/ I want to know if im able to sideload an object list inside a sideloaded object with ember-data rest adapter, I am receiving the following output from the backend: { …

Continue Reading

Ember Data model find by query deferred?

April 29, 2021 by Code Error

Posted By: Anonymous If I have a query that defines the model for my route: App.MyRoute = Ember.Route.extend({ model: function (params) { return this.store.find(‘MyModel’, {myProperty: myValue}).then(function(results) { return results.get(‘firstObject’); }); } }); How do I handle the case where the store has not yet been populated with the results of the above query? I want …

Continue Reading

How to check if a model has been changed but has not been saved to the server? (Ember.js / Ember-data)

April 29, 2021 by Code Error

Posted By: Anonymous With ember models as they are changed by user input, they are persisted over the application with the changed values (until a refresh of some sort to reload the data from the server). Now these models and their changes have not been saved to the server. So I am wondering how I …

Continue Reading

How to support multiple API hosts with Ember data?

April 29, 2021 by Code Error

Posted By: Anonymous I have an Ember application (with ember data) that is run on a user’s machine. There’s an API server running on their machine, and one running online. I need to allow users to choose where a model is persisted (the API running on their machine, or the online API). So, two API …

Continue Reading

Route’s Model Hook with Ember Data “filter” not loading dependent computed property

April 29, 2021 by Code Error

Posted By: Anonymous Hopefully you can help me! 🙂 My issue is that I have a Route that looks like this which I’m expecting to populate a list of items… i.e. “only the tagged ones, please”, but it doesn’t: App.TaggedItemsListRoute = App.ItemsRoute.extend({ model: function() { var store = this.get(“store”); var storePromise = store.find(“item”, { has_tags: …

Continue Reading

Alternative To Associations with EmberJS/Data

April 29, 2021 by Code Error

Posted By: Anonymous I’ve been working on an EmberJS application for about a week now, and have written my own localStorage adapter for EmberJS/Data to allow for data persistence. The app is a small note-taking application. Ideally, I’d like to have a Notebook model that has many Note models associated with it. However, I haven’t …

Continue Reading

How do I set default values for all data types in Ember Data?

April 29, 2021 by Code Error

Posted By: Anonymous I have a model that does not provide default values for any of its properties. I have this model bound to the template and I would like to save the model on transition only if it’s dirty. However, simply entering a text field then leaving the text field will cause the record …

Continue Reading

How can I get ember data content from view?

April 29, 2021 by Code Error

Posted By: Anonymous Model: Blocks.NVD3Chart = Blocks.DSModel.extend({ xAxis: DS.attr() ,series: DS.attr() }) Blocks.NVD3Chart.FIXTURES = [ { “id”: “02c6486ac0a8017400348bcdb2029c63asdf” ,xAxis: [1,2] ,series: [ { data: [10,20] ,name: “Employment” } ] }] Route: Blocks.LetsseeRoute = Ember.Route.extend({ model: function() { return this.store.find(‘NVD3Chart’) } }) View: Blocks.LetsseeView = Ember.View.extend({ templateName: ‘letssee’, drawChart: function () { console.log(this.get(“controller.content”)) console.log(this.get(“controller.model”)) }.on(“didInsertElement”) }) …

Continue Reading

How can I serialize hasMany relations with ember-data > beta15?

April 29, 2021 by Code Error

Posted By: Anonymous Until ember-beta 14, everything was going fine. I have goal and account models. goal hasMany(‘account’), but account does not have or belongs to goals (not on ember, there are no reason on my app. With a custom serializer, I had all working fine: //serializers/goal.js import DS from ’ember-data’; export default DS.ActiveModelSerializer.extend(DS.EmbeddedRecordsMixin, { …

Continue Reading

Ember-Data: Adding Server Queries to AJAX Requests

April 29, 2021 by Code Error

Posted By: Anonymous I am having trouble with a specific case using Ember-Data. Typically Ember expects a model class, the route, the ajax request, and the returned JSON, to all follow a similar pattern. The RESTAdapter tries to automatically build a URL to send to the server, which is ok for some situations, but I …

Continue Reading

No template update after createRecord with findQuery fetching

April 29, 2021 by Code Error

Posted By: Anonymous I’m wonder why my template doesn’t get updated after createRecord when using findQuery to fetch data. When changing this return this.store.findQuery(‘timetracking’, {year: year, month: month, user_id: user_id}); to return this.store.find(‘timetracking’); the template gets updated with my new records. I don’t want to fetch all records to save bandwith, but when using only …

Continue Reading

Define a complex model

April 29, 2021 by Code Error

Posted By: Anonymous I have the following user object (json): { “_id”: “my-id”, “org”: 666, “type”: “user”, “properties”: { “first_name”: “Firstname”, “surname1”: “Surname1”, “surname2”: “Surname2”, “allowed_apps”: [ “one-app”, “another-app” ], “default_app”: “one-app”, “email”: “[email protected]” }, “outputs”: { “extension”: “extension-id” } } This is a single model, with a complex structure. It is not a “multi-model …

Continue Reading

Remove model name from ember data json

April 28, 2021 by Code Error

Posted By: Anonymous Ember data send data to the server with the model name embedded. { “part” { “name” : “test1”, “quantity” : 12 } } I want the “part” field removed from the response so it would look like: { “name” : “test1”, “quantity” : 12 } I need this to be generic so …

Continue Reading

Unable to bind isVisible for input field to model data

April 28, 2021 by Code Error

Posted By: Anonymous Here’s the jsfiddle showing what I’m trying to do: http://jsfiddle.net/jdivock/ymgwh/1/ On the main app I’m trying to bind input and select fields to show/hide depending on whether or not a checkbox is selected. Sounds easy right? I’m confused as to why this won’t work. I can set a disabledBinding no problem, and …

Continue Reading

Emberjs – unable to query for embedded model or association

April 28, 2021 by Code Error

Posted By: Anonymous A small portion of this fiddle: http://jsfiddle.net/v2t67/ is displayed in my question, but my problem is that i am unable to query for the json of the child model ie the comment model. As of now, i can access the parent object (Post Model) from chrome developer console using the queries below …

Continue Reading

Ember DS.Store error while submitting form

April 28, 2021 by Code Error

Posted By: Anonymous I’m a newbie to ember and I’m trying to create a basic sign-up form. Relevant model: App.NewUser = DS.Model.extend({ user_name: DS.attr(‘string’), password: DS.attr(‘string’), confirm_password: DS.attr(‘string’), email: DS.attr(‘string’), first_name: DS.attr(‘string’), last_name: DS.attr(‘string’), }); Relevant controller: App.SignupController = Ember.ArrayController.extend({ actions: { signup: function() { var data = this.getProperties(‘first_name’, ‘last_name’, ’email’, ‘user_name’, ‘password’, ‘confirm_password’); var …

Continue Reading

How can I peek the contents of a hasMany relationship?

April 28, 2021 by Code Error

Posted By: Anonymous I have a model, Node: App.Node = DS.Model.extend({ parents: DS.hasMany(‘node’, { inverse: null }) }); Let’s say my server is sending back a partial tree: { id: “A”, parents: [ “C” ] } { id: “B”, parents: [ “C”, “D” ] } { id: “C”, parents: [ “E” ] } I want …

Continue Reading

How do I save data to my Ember store if the POST response contains only an id?

April 28, 2021 by Code Error

Posted By: Anonymous Ember data expects my server to return the full object after each successful POST. However, my API only returns a kind of meta-object that contains the id. When Ember receives this object, the existing data in the record gets deleted except for the id. So for example, when I do this: var …

Continue Reading

Posts navigation

  • 1
  • 2
  • 3
  • 4
  • …
  • 29
  • Next

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error