ember-cli

Ember testing: You have turned on testing mode, which disabled the run-loop's autorun

你离开我真会死。 提交于 2019-12-23 09:27:15
问题 I am trying to write a simple Ember integration test and continue to get the frustrating run loop error despite using Ember.run . I've had a nightmare of a time trying to get this to work, if anyone could help me I'd be so grateful. Specifically, I can see the test sign in and begin loading the next page (as it should), but as soon as the test finishes I get that error. This is regarding the second test, the first passes (as nothing is async I believe). import Ember from 'ember'; import

How to use a favicon with ember-cli?

痞子三分冷 提交于 2019-12-23 07:12:47
问题 I had a favicon working for a while on my index template, but not any any other template, and now even my index template won't show it. I'm just in development, so I'm using ember server . index.html <link rel="icon" href="favicon.ico"> Just throwing around my favicon to see if it shows up anywhere, I now have it in the following locations: app/ public/ public/assets I think this should be very straightforward, especially since the index page doesn't change, just get's new stuff loaded into

Ember CLI Hook/Event Error

妖精的绣舞 提交于 2019-12-23 03:59:09
问题 I'm using Ember CLI 1.13 and I'm attempting to create a router mixin in an addon that binds to the willTransition hook, but the issue I'm encountering is not limited to this event. At this point the mixin looks like such: import Ember from 'ember'; export default Ember.Mixin.create({ genericFunction: function(transition) { console.log('--- generic function ---'); }.on('willTransition') }); When attempting to run the dummy app utilising the mixin, I get the following error: Uncaught TypeError:

How to set the i18n.locale from within an initializer

半世苍凉 提交于 2019-12-23 02:51:03
问题 I would like to set 'i18n.locale' from within an initializer in EmberJS. I am using 1.12 via Ember-CLI with ember-i18n. I tried this import Ember from 'ember'; export function initialize(container, application) { Ember.set('i18n.locale', 'de'); } export default { name: 'user-locale', initialize: initialize } but am receiving Assertion Failed: Path 'i18n.locale' must be global if no obj is given. 回答1: You could get i18n as service:i18n and use instance-initializer to set i18n.locale . //app

Ember-cli moving files to an external folder

≡放荡痞女 提交于 2019-12-23 02:41:30
问题 So I have an ember CLI app that's in something like 'c:/foo/bar/ember' and want to have the final generated files copy to 'c:/foo/emberApp'. When I do the broccoli build i get all the built files into c:/foo/bar/ember/dist. I'd like to pick some of these files and move them to c:/foo/emberApp. What's the best way to go about this? I've seen people use grunt but this would mean I lose the broccoli speed increase. My brocfile is just the basic ember-cli one, no modifications. I'll include below

How to implement multiple filters with checkboxes in emberjs?

拜拜、爱过 提交于 2019-12-22 15:37:21
问题 How do I implement multiple filters with checkboxes in emberjs? I would like to filter a grid table with the items that have certain properties that are checked in the template checkboxes... For example, if I have this fixture: export default employees[ { name: 'Ricky', department: 'Finance', departmentIsChecked: false }, { name:'George', department:'Marketing' departmentIsChecked:false }, { name:'Jonah', department: 'Finance', departmentIsChecked:false } ]; how would I only display the

Initialized dependency not present when testing

旧巷老猫 提交于 2019-12-22 08:46:27
问题 I'm using ember-cli 0.0.35, and injecting a dependency onto my component via an initializer. It works great in development, but the property isn't present when I run tests. It appears that testing calls loadInitializers, but the dependency is not showing up on this.subject({}); I don't want to manually inject it for the tests. Is there a better way to handle this? Initializer: var FooServiceInitializer = { name: 'foo', initialize: function (container, application) { application.inject(

How to upgrade the Ember version in an Ember CLI application?

我的梦境 提交于 2019-12-22 08:44:46
问题 Assuming I created this Ember application last week: ember new shop cd shop ember install:addon ember-cli-scaffold ember g scaffold product name:string The console tells me that this application uses Ember 1.10.0: How can I upgrade this Ember application to Ember version 1.11.0? 回答1: The syntax has been updated to: bower install ember#2.0.0 --save-dev --save-exact 回答2: @Sukima's answer will work fine, but you can also use the ember-cli command: ember install:bower ember#<version> In your case

How to use md5.js within a compontent?

隐身守侯 提交于 2019-12-22 08:23:58
问题 I just started working with Ember-CLI 0.0.36 and I'm stuck with the Gravatar example code from the Ember.js homepage. I did > bower install --save JavaScript-MD5 > ember generate component gravatar-image Brocfile.js [...] app.import('vendor/JavaScript-MD5/js/md5.js'); [...] app/components/gravatar-image.js import Ember from 'ember'; export default Ember.Component.extend({ size: 200, email: '', gravatarUrl: function() { var email = this.get('email'), size = this.get('size'); return 'http://www

Ember-CLI: Is there a way to copy a (vendor) directory to /public/assets?

旧时模样 提交于 2019-12-22 04:09:11
问题 In an Ember-CLI project, if I add a directory containing webfonts and their CSS stylesheets to the public/assets directory, I can use them with something like @import 'assets/font/regular/stylesheet.css . This works fine. Ideally though, I'd like to keep these assets out my git repository, and instead bower install them as client-side dependencies, but how can these assets be used in the Ember-CLI build? The documentation mentions app.import(FILE) in Brocfile.js , which works for CSS