ember.js

How to generate image sprites in ember-cli using compass?

别等时光非礼了梦想. 提交于 2019-12-17 18:25:53
问题 Update - 20140614: After not getting any answers to this question, or on github, I decided to come up with my own solution to the problem. I was using compass for a number of things, but its main utility was in its ability to generated image sprites. Most other things could be accomplished using pure SCSS. Thus, I wrote broccoli-sprite. This, used in conjunction with ember-cli's built in support for SCSS using broccoli-sass, was able to meet my needs. You can read more about the process here.

How do I add a separator between elements in an {{#each}} loop except after the last element?

陌路散爱 提交于 2019-12-17 18:16:54
问题 I have a Handlebars template where I'm trying to generate a comma-separated list of items from an array. In my Handlebars template: {{#each list}} {{name}} {{status}}, {{/each}} I want the , to not show up on the last item. Is there a way to do this in Handlebars or do I need to fall back to CSS selectors? UPDATE : Based on Christopher's suggestion, this is what I ended up implementing: var attachments = Ember.CollectionView.extend({ content: [], itemViewClass: Ember.View.extend({

Accessing Index in #each in emberjs

情到浓时终转凉″ 提交于 2019-12-17 18:14:50
问题 Please check out the code attached http://jsbin.com/atuBaXE/2/ I am trying to access the index using {{@index}} but not seems to be compiling. I think handlebars supports that {{#each item in model}} {{@index}} {{item}} {{/each}} It is not working out for, I can't figure out if the {{@index}} is supported or not I am using Ember.VERSION : 1.0.0 Handlebars.VERSION : 1.0.0 回答1: UPDATE Since this PR, it's now possible to use the each helper with index, taking advance of the new block params

Accessing controllers from other controllers

别等时光非礼了梦想. 提交于 2019-12-17 15:56:24
问题 I am building a project management app using ember.js-pre3 ember-data revision 11. How do I initialize a couple of controllers and make them available globally. For example I have a currentUser controller and usersController that I need access to in every state. I used to have the following code in the Ember.ready function but It no longer works. I guess the way I was doing it was intended for debugging. https://github.com/emberjs/ember.js/issues/1646 Old Way: window.Fp = Ember.Application

What is Ember RunLoop and how does it work?

女生的网名这么多〃 提交于 2019-12-17 15:01:07
问题 I am trying to understand how Ember RunLoop works and what makes it tick. I have looked at the documentation, but still have many questions about it. I am interested in understanding better how RunLoop works so I can choose appropriate method within its name space, when I have to defer execution of some code for later time. When does Ember RunLoop start. Is it dependant on Router or Views or Controllers or something else? how long does it approximately take (I know this is rather silly to

Ember.js: Handlebars displays nothing

时光怂恿深爱的人放手 提交于 2019-12-17 14:56:11
问题 /app.js var Welcome = Ember.Application.create({}); Welcome.person = Ember.View.extend({ personName: 'Andrew' }); Here is the content of the index.html, part of the view: /index.html <!doctype html> <!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--

Ember data multi level hierarchy with embedded always

ε祈祈猫儿з 提交于 2019-12-17 13:40:11
问题 I am able to use embedded always for one level but I am unable to use it for two level deep model. Need an urgent help App.Post = DS.Model.extend( title: DS.attr("string") comment: DS.belongsTo("App.Comment") ) App.Comment = DS.Model.extend( text: DS.attr("string") ferment: DS.belongsTo("App.Ferment") ) App.Ferment = DS.Model.extend( fermenter: DS.attr("string") ) App.Adapter.map App.Post, 'comment': embedded: "always" App.Adapter.map App.Comment, ferment : embedded: "always" # --------------

Is resource nesting the only way to enable multiple dynamic segments?

蓝咒 提交于 2019-12-17 10:52:22
问题 This seems to suggest that the answer is yes: From Ember Pre1 to Pre4: Multiple dynamic segments per route? Update: What is the allowed syntax for dynamic segments? ... but I just want to confirm. In my case, as a learning exercise, I'm building a calendar in Ember, with monthly displays. I need to be able to link from a given month to the previous month, and to the next month. So I'd like to be able to {{ linkTo calendar_month year month }} and this.transitionTo('calendarMonth', year, month)

Is resource nesting the only way to enable multiple dynamic segments?

百般思念 提交于 2019-12-17 10:52:21
问题 This seems to suggest that the answer is yes: From Ember Pre1 to Pre4: Multiple dynamic segments per route? Update: What is the allowed syntax for dynamic segments? ... but I just want to confirm. In my case, as a learning exercise, I'm building a calendar in Ember, with monthly displays. I need to be able to link from a given month to the previous month, and to the next month. So I'd like to be able to {{ linkTo calendar_month year month }} and this.transitionTo('calendarMonth', year, month)

Ember Data model's errors property (DS.Errors) not populating

喜夏-厌秋 提交于 2019-12-17 09:54:02
问题 I'm using Ember Data and I can't seem to get the model's 'errors' property to populate with the error messages from my REST API. I'm pretty much following the example at this guide: http://emberjs.com/api/data/classes/DS.Errors.html My app looks like this: window.App = Ember.Application.create(); App.User = DS.Model.extend({ username: DS.attr('string'), email: DS.attr('string') }); App.ApplicationRoute = Ember.Route.extend({ model: function () { return this.store.createRecord('user', {