ember.js

How should I get the value of this input field?

泪湿孤枕 提交于 2019-12-24 04:05:26
问题 I am using a subexpression at {{input value=(cents-to-dollars model.amountInCents)}} . It is using a custom helper to convert the value from cents to dollars. My API returns cents. However in the controllers save action, console.log(this.get('model.amountInCents')); returns undefined . Am I missing something? Maybe name or valueBinding in the input helper? If I remove the subexpression. console.log(this.get('model.amountInCents')); outputs fine. // Routes import Ember from 'ember'; export

How should I get the value of this input field?

China☆狼群 提交于 2019-12-24 04:04:06
问题 I am using a subexpression at {{input value=(cents-to-dollars model.amountInCents)}} . It is using a custom helper to convert the value from cents to dollars. My API returns cents. However in the controllers save action, console.log(this.get('model.amountInCents')); returns undefined . Am I missing something? Maybe name or valueBinding in the input helper? If I remove the subexpression. console.log(this.get('model.amountInCents')); outputs fine. // Routes import Ember from 'ember'; export

Accessing Multiple Models with One Action

假装没事ソ 提交于 2019-12-24 03:52:46
问题 I have multiple models within my index route which I declared like so: App.IndexRoute = Em.Route.extend({ model: function(){ return Ember.RSVP.hash({ dogs: this.store.find('dog'), cats: this.store.find('cat') }) }) And I'm able to render them fine by doing this: <script type="text/x-handlebars" data-template-name="index"> {{render 'dogs' dogs}} {{render 'cats' cats}} </script> The problem I am facing now, is that I want to pass a single action from the index to specific actions on each of

Accessing Multiple Models with One Action

时光毁灭记忆、已成空白 提交于 2019-12-24 03:52:06
问题 I have multiple models within my index route which I declared like so: App.IndexRoute = Em.Route.extend({ model: function(){ return Ember.RSVP.hash({ dogs: this.store.find('dog'), cats: this.store.find('cat') }) }) And I'm able to render them fine by doing this: <script type="text/x-handlebars" data-template-name="index"> {{render 'dogs' dogs}} {{render 'cats' cats}} </script> The problem I am facing now, is that I want to pass a single action from the index to specific actions on each of

Writing a LightboxView causes problems / Integrating DOM Manipulating jQuery-Plugins makes actions unusable

江枫思渺然 提交于 2019-12-24 03:39:27
问题 General Problem Problems can arise, when one trys to integrate DOM Manipulating 3rd Party libraries. In this particular case, a jQuery Lightbox plugin caused problems. Original Question Currently i am trying to integrate the following Lightboxplugin into an Ember View: http://codecanyon.net/item/jquery-lightbox-evolution/115655 This is my current code for the View: App.LightboxView = Ember.View.extend({ templateName : 'whatever', isVisible : false, willInsertElement : function(){ var that =

Masonry not working for infinite scrolling in Ember

别来无恙 提交于 2019-12-24 03:34:39
问题 I'm trying to use Jquery Masonry for my image gallery with infinite scrolling. Masonry is only working for the images in the route. But after pushing new image object to images array, the new image appears in the Dom but Masonry not working. I've seen Ember.js - jQuery-masonry + infinite scroll and tried but my code still not working. Image gallery route: App.ImggalleryRoute = Ember.Route.extend({ model: function(){ return { images: [ { name: "car", src_path: "0dbf51ac84e23bd64d652f94a8cc7a22

Ember.js Application.inject circular dependencies

守給你的承諾、 提交于 2019-12-24 03:23:24
问题 Hi, I'm about 2 weeks into building my application with ember.js, and the time has come to pull together my project layout into its final shape. To that end, I started looking into using Ember's register / inject mechanism instead of just creating global singletons and attaching them to my App object (for an excellent description of dependency injection in Ember, see here) I'm stuck with standard dependency injection dilemma - circular references. Let's say, I have two manager-like classes

Formatting JSON using the RESTSerializer in the latest Ember Data version

爱⌒轻易说出口 提交于 2019-12-24 03:20:45
问题 I'm struggling to 'munge' my JSON into the correct format. To illustrate i've made a quick, JSfiddle. http://jsfiddle.net/chrismasters/NQKvy/638/ The format the server returns the data has a couple of differences to the preferred format recommended by Ember Data now. Here is the raw JSON output { "video": { "uuid": "8a660002-03c6-4b8e-bd8b-4ce28fa0dacd", "state": "pending", "theme": "basic", "resolution": "nHD", "title": "Test title", "track": { "uuid": "376fc3bb-d703-49e7-9d92-bce7f6bf8b56",

Ember component call an action in a route or controller

大兔子大兔子 提交于 2019-12-24 03:20:15
问题 I have a component the main purpose of which is to display a row of items. Every row has a delete button to make it possible to delete a row. How is possible to pass an action from a template to the component which will trigger an action in a router ? Here is the template using the component: #templates/holiday-hours.hbs {{#each model as |holidayHour|}} {{holiday-hour holiday=holidayHour shouldDisplayDeleteIcon=true}} {{/each}} Here is the component template: # templates/components/holiday

emberjs how to disable Ember.Select?

橙三吉。 提交于 2019-12-24 03:02:52
问题 i have a similar question to this question Emberjs - Disable and Enable TextField so for text field it's disabledBinding. what about Ember.Select (drop down field)? i tried disabledBinding but it's not working. thanks! 回答1: It's not working because disabled is not defined in attributeBindings , see code. A solution is to extend the Ember.Select and add disabled to the concatenated property* attributeBindings , see http://jsfiddle.net/pangratz666/wTXfH/: Handlebars : <script type="text/x