ember.js

Different Ember Routes or Displaying Two Complex Views in their own context

笑着哭i 提交于 2020-01-22 16:03:16
问题 I have an app with different related concerns. I have a list of items on the left that affect some of the items on the right (think Github Issues), but here's a mockup All fine, I click Item One and something happens on the right. However, the list on the left has its own routing requirements, it's a resource of items with nested routes. For example when we click on Create New Item we display a new form inline (see bottom left corner) When I do that it, even if it's on a different outlet, it

Different Ember Routes or Displaying Two Complex Views in their own context

 ̄綄美尐妖づ 提交于 2020-01-22 16:03:11
问题 I have an app with different related concerns. I have a list of items on the left that affect some of the items on the right (think Github Issues), but here's a mockup All fine, I click Item One and something happens on the right. However, the list on the left has its own routing requirements, it's a resource of items with nested routes. For example when we click on Create New Item we display a new form inline (see bottom left corner) When I do that it, even if it's on a different outlet, it

Why the ember-cli is so slow

大兔子大兔子 提交于 2020-01-22 14:16:09
问题 I migrated my grunt project to ember-cli, I found the time from file modification to liveload completion was so long, about 10 minutes. After I installed ember-cli-windows, ember-cli-windows-addon, no obvious prompt was gained. The following is one example output after ember-cli-windows, ember-cli-windows-addon installed: file changed routes\services.js Build successful - 382781ms. Slowest Trees | Total ----------------------------------------------+--------------------- Babel | 82175ms

Using LoDash with EmberCLI

◇◆丶佛笑我妖孽 提交于 2020-01-22 13:56:25
问题 Does anyone have a working example of a (simple) ember-app project built using Ember-CLI that uses LoDash? (e.g.: I want to use lodash, _.someLodashFunc, in my Routes and Controllers). I haven't seen any thread / article on the web that gives clear, step-by-step explanation on how to do that. If possible with lodash v3.0.0 (and I'm using the latest ember-cli, v0.1.9). Thanks, Raka I found out how, you need to generate a custom build of lodash (the "lodash modern"). Use lodash-cli: https:/

How to run QUnit tests from command line?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-22 13:55:25
问题 I recently started working on a Rails app that has a large amount of QUnit tests already in place for testing ember. I have been charged with the task of setting the app with a CI (I decided to use CodeShip). The issue I currently face is that the only way for me to run the qunit tests is to go to http://localhost:3000/qunit . I need to setup a way to run the tests from the command line. I have done a large amount of research, and have tried at least 10 different solutions but non have

Dynamic computed properties in Ember.JS deprecated?

早过忘川 提交于 2020-01-22 12:22:25
问题 I am trying to make an ember application. I have a computed property and the controller looks like this: // The Controller Todos.Controller = Ember.Controller.create({ // ** SNIP ** // countCompleted: function() { return this.get('todos').filterProperty('completed', true).length }.property(), }); // The View {{Todos.Controller.countCompleted.property}} Items Left Now the tutorial I'm following is using an older version of Ember.JS. I've fixed every error but this: Uncaught Error: assertion

Request Two Models together

 ̄綄美尐妖づ 提交于 2020-01-22 07:10:23
问题 I have two models that are many to many. They're used on the first page of my app and I'm having trouble loading them. Both models only have a handful of items (<200) and I'd like to just load both models completely in one findAll request each. But as the first model gets loaded, Ember starts fetching the missing data for the second model, item by item. If I try to just load the models separately, I get an error and have to set {async:true} for the hasMany attr. For some reason though, Ember

Emberjs will not load jquery/javascript, run code when html is inserted in the page

大城市里の小女人 提交于 2020-01-21 17:24:12
问题 Help! I'm working on a meaty emberjs/yeoman project that uses multiple hbs templates that can all be routed to from one application.hbs's sidebar. The problem is when I load the page, sometimes the Jquery to make that sidebar collapse will not work while other jquery in that same file does. Sometimes nothing works at all. I'm calling my javascript/jquery from one file called magic.js <body> <!-- build:js scripts/components.js --> <script src="bower_components/jquery/jquery.js"></script>

Emberjs will not load jquery/javascript, run code when html is inserted in the page

扶醉桌前 提交于 2020-01-21 17:23:30
问题 Help! I'm working on a meaty emberjs/yeoman project that uses multiple hbs templates that can all be routed to from one application.hbs's sidebar. The problem is when I load the page, sometimes the Jquery to make that sidebar collapse will not work while other jquery in that same file does. Sometimes nothing works at all. I'm calling my javascript/jquery from one file called magic.js <body> <!-- build:js scripts/components.js --> <script src="bower_components/jquery/jquery.js"></script>

Ember initializing route model with query

倾然丶 夕夏残阳落幕 提交于 2020-01-21 12:18:22
问题 I am trying to initialize a Route's model with a DS query, as follows App.Router.map(function() { this.resource('post', { path: '/posts/:post_slug' }); }); App.PostsRoute = Ember.Route.extend({ model: function(params) { var records = App.Post.find({ slug: params.post_slug }); return records.get('firstObject'); } }); Here, i find a Post by its slug and set the first result as the route model. but since records is populated asynchronously, the model data is not set properly. What is the correct