ember.js

Ember-data fixtures adapter not loading all data

梦想与她 提交于 2020-01-01 12:11:23
问题 I have an ember-data model definition that looks like this: Sylvius.Filter = DS.Model.extend({ title: DS.attr('string'), slug: DS.attr('string'), // Belongs to Atlas atlas: DS.belongsTo('Sylvius.Atlas'), // Has images images: DS.hasMany('Sylvius.Image'), // May have AtlasExtras extras: DS.hasMany('Sylvius.AtlasExtra'), // Structures for this filter structures: DS.hasMany('Sylvius.Structure'), // This is the path to the thumbnails sprite. // Each image will have an index on this sprite

Ember-data fixtures adapter not loading all data

为君一笑 提交于 2020-01-01 12:11:09
问题 I have an ember-data model definition that looks like this: Sylvius.Filter = DS.Model.extend({ title: DS.attr('string'), slug: DS.attr('string'), // Belongs to Atlas atlas: DS.belongsTo('Sylvius.Atlas'), // Has images images: DS.hasMany('Sylvius.Image'), // May have AtlasExtras extras: DS.hasMany('Sylvius.AtlasExtra'), // Structures for this filter structures: DS.hasMany('Sylvius.Structure'), // This is the path to the thumbnails sprite. // Each image will have an index on this sprite

Ember.js based dashboard

杀马特。学长 韩版系。学妹 提交于 2020-01-01 11:50:39
问题 I'm developing an application using ember.js and a rest API written with spring MVC. I have to create a dashboard with several widget on it. Every widget as its own behavior and will call different API method. I was thinking to have one controller subclass for each kind of widget. Then will instantiate them and will add ther views to a Container view. However ember will create a instance for each controller automatically, so is it a good path to follow? Any suggestion fom the ember.js

Emberjs + data + rails - Uncaught TypeError: Cannot call method 'map' of undefined

我的梦境 提交于 2020-01-01 10:26:44
问题 When I am trying to load data from rails db with emberjs + ember data I am getting this error Uncaught TypeError: Cannot call method 'map' of undefined Here's the coffescript code: window.Cosmetics = Ember.Application.create Cosmetics.store = DS.Store.create revision: 4 adapter: DS.RESTAdapter.create bulkCommit: false Cosmetics.admin_user = DS.Model.extend({ name: DS.attr('string') email: DS.attr('string') }); Cosmetics.view = Ember.View.extend templateName: 'ember/views/aaa' Cosmetics.admin

Observer are not called on create()

前提是你 提交于 2020-01-01 09:54:09
问题 I have a Ember.Mixin which observes one of its properties (here bar.baz ). I've extended this Mixin and set bar.baz in the .create() parameter, but my observer is not called. Here is my code : App.FooMixin = Ember.Mixin.create({ barBazDidChange: function() { console.log('barBazDidChange'); // never called }.observes("bar.baz") }); App.Foo = Ember.Object.extend(App.FooMixin); App.fooObject = App.Foo.create({ bar: Ember.Object.create({ baz: "ember" }) });​ And the associated jsfiddle : http:/

How should I share data between Ember components?

三世轮回 提交于 2020-01-01 08:52:33
问题 My Ember app has a route that contains 2 different components and one controller with an index.hbs template. Here's what it looks like: 1) A user can select multiple filters from the dropdowns of the Filter Component 2) The DataGrid is a separate component from the filter 3) A user can select multiple rows from the DataGrid by checking boxes 4) Create Custom Report button fires "sendAction" to the route's controller This data is not model-specific... it's just temporary data that is required

How should I share data between Ember components?

99封情书 提交于 2020-01-01 08:52:06
问题 My Ember app has a route that contains 2 different components and one controller with an index.hbs template. Here's what it looks like: 1) A user can select multiple filters from the dropdowns of the Filter Component 2) The DataGrid is a separate component from the filter 3) A user can select multiple rows from the DataGrid by checking boxes 4) Create Custom Report button fires "sendAction" to the route's controller This data is not model-specific... it's just temporary data that is required

Ember.js {{each}} vs {{collection}}

北战南征 提交于 2020-01-01 08:31:27
问题 I understand each and collection helper methods are two possible ways to iterate over a list of items in my handlebars templates. I am looking for some practical advice about when to use each or collection and what are the differences between the two methods. 回答1: Each: App.myArray = [1,2,3] {{#each value in App.myArray}} <p>{{value}}</p> {{/each}} corresponding HTML <p>1</p> <p>2</p> <p>3</p> Collection: {{#collection contentBinding="App.myArray"}} <p>{{view.content}}</p> {{/collection}}

Using mixins with Ember-cli?

偶尔善良 提交于 2020-01-01 08:25:33
问题 I have a mixin app/mixins/ui-listener.js which I'm struggling to use with Ember-CLI. I'm trying to use the mixin with the following syntax: import ListenerMixin from './mixins/ui-listener'; export default Ember.Component.extend(ListenerMixin,{ // class definition } This fails when I save it, complaining that ENOENT, no such file or directory 'tmp/tree_merger-tmp_dest_dir-74tK3rvD.tmp/[app-name]/components/mixins/ui-listener.js' It seems funny that the "mixins" directory is nested under the

Is it possible to observe arrays within arrays using @each?

柔情痞子 提交于 2020-01-01 07:21:11
问题 I have a controller that contains an array of "things". Within each of these things is an array of "subthings". I'd like to create a computed property that contains all subthings in all things (a flattened array of subthings). My computed property depends on things.@each.subthings.length . I find that if I set the subthings property of a thing, my computed property is updated. However if I call pushObjects to add new data to my existing subthings array, my computed property does not update. I