ember-2.0.0

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

How to detect and save relation change in Ember 2.13.0?

拥有回忆 提交于 2019-12-23 09:47:38
问题 I have documents list. Every document has client attribute defined by belongsTo . When user change client in one of documents i want to show in the counter how many documents are changed. And when user decide he will press "publish" button which will save documents client changes to api. DS.Model in ember 2.13 has parameters (https://emberjs.com/api/data/classes/DS.Model.html): hasDirtyAttributes, dirtyType Both of them does not react on belongsTo/HasMany changes by Ember design . I saw many

How do I pass in more than one parameter to the onChange action for the select element in Ember2.3

情到浓时终转凉″ 提交于 2019-12-22 05:39:17
问题 I have a select element within a loop, and the action I want to be triggered needs to have two parameters: the selected option of the select element and the item we are looping with. My code looks like so: {{#each loopItems as |loopItem|}} <select onChange={{action 'fireThis' loopItem target.value }}> {{#each loopItem.subItems as |subItem|}} <option value={{subItem.id}}>{{subItem.value}}</option> {{/each}} </select> {{/each}} And my fireThis action is like so: fireThis:function(loopItem,

Ember parent child component, how to avoid unnecessary life cycle hook from triggering?

孤者浪人 提交于 2019-12-12 05:59:54
问题 Child component property update is triggering all the parent component willUpdate , willRender , didUpdate and didRender life cycle hook methods. but I just updated property which is visible only the child component, It has nothing to do with parent component. Twiddle to check. Twiddle to check with powerselect - when mouse over dropdown option it's triggering the all of its parent component willUpdate , willRender , didUpdate and didRender life cycle hook methods. Is there any way I can

Ember 2, model.save() from component my-modal.hbs

☆樱花仙子☆ 提交于 2019-12-12 04:02:31
问题 I have this posts.hbs : {{#each model as |post|}} <a href="#" {{action 'openWriteModal' post}}> <h3>{{post.title}}</h3> {{post.text}} {{post.author.name}} </a> {{/each}} Then I open my write-modal.hbs : {{input value=model.title size="40" escape-press='close'}} {{model.author.name}} {{input value=model.text size="70" escape-press='close'}} <button {{action 'close'}}>Close</button> <button {{action 'save' model}}>Save</button> Now, this is my components/write-modal.js : export default Ember

Passing parameters between routes in Ember 2.x

杀马特。学长 韩版系。学妹 提交于 2019-12-11 06:01:35
问题 While going from one route to another, I want to pass some data (especcially arrays). How is it possible? Why can't we use query-params with arrays? Is it a problem storing data in a specific service during transition? Note: I know there are some old questions those are nearly the same with this question. But their selected answers are no more applicable for Ember 2.x. Those questions are: 1, 2. 回答1: I´m not sure if queryparams won´t work with arrays as I only used it with single ids, but it

Ember.js 2.3 implement @each.property observer on a HasMany relationship?

£可爱£侵袭症+ 提交于 2019-11-26 21:44:45
问题 Say I have a hasMany relationship Procedure => hasMany Steps, with async:true, and I have a Procedure Component (on the procedure route) called procedure-main, which lists the steps as so: {{#each steps as |step| }} {{step.title}} {{/each}} I need to observe a property on each step (say, stepStatus) on change to the stepStatus on any of the steps. In Ember 1.7, I had something like this on the procedure controller: stepsStatusObserver: function(){ ... }.observes('steps.@each.stepStatus') This