ember-cli

'equal' is not defined : Ember-qunit does not seem to be importing

守給你的承諾、 提交于 2019-12-05 09:07:18
It appears the Qunit test methods aren't available even though I'm pretty sure I am importing them correctly. I get the following errors: unit/models/friend-test.js: line 11, col 3, 'ok' is not defined. unit/models/friend-test.js: line 17, col 3, 'equal' is not defined. unit/models/friend-test.js: line 23, col 3, 'equal' is not defined. unit/models/friend-test.js: line 31, col 3, 'equal' is not defined. unit/models/friend-test.js: line 32, col 3, 'equal' is not defined. I have this test file unit/models/friend-test : import Ember from 'ember'; import { moduleForModel, test } from 'ember-qunit'

Ember-CLI: Fix for “'Ember' is not defined”?

若如初见. 提交于 2019-12-05 06:45:27
问题 When using Ember-CLI and running ember server, I get the following error from JSLint: [app_path]/filename.js: line 1, col 16, 'Ember' is not defined. Adding import Ember from 'ember'; fixes this. Is this the official way to go now on all my files? The documentation does not mention this change yet. 回答1: EDIT From Stephan Penner: We explicitly left it [Ember] out [of the .jshintrc file], please import ember instead. We plan on exposing more and more of ember as es6, someday this will allow the

ember cli and livereload: how to get it to work?

爷,独闯天下 提交于 2019-12-05 04:52:34
I can't for the life of me get livereload to work with my ember cli project. This is the first time I try livereload, so I don't know if this problem is specific to ember cli, or if my Mac environment is not set up for it. Here is what I have installed $ ember --version: version: 0.0.46 node: 0.10.32 npm: 1.4.27 Here is how I got everything running: $ ember new foo-bar $ cd foo-bar $ ember server version: 0.0.46 Livereload server on port 35729 Serving on http://0.0.0.0:4200 Navigating to http://localhost:4200 in Chrome shows me the ember app. Now if I make changes to 'application.hbs' and then

How to use the new ember-cli http-mock for API calls

房东的猫 提交于 2019-12-05 01:25:41
I have a simple (so far) ember-cli project, and right now just have one model with FIXTURE data. I would like to mock up API stuff, either with actual JSON files, or with http-mock , which is the ember-cli version 41 name of what used to be api-stub . I'm pretty new to all this, so I really didn't know what to make of the info I found where people were able to get api-stub working, and it doesn't look like any docs on the ember-cli have been updated with http-mock info yet. I did do ember generate http-mock project but I'm not sure really what to do from here. Here's my current app/router.js:

Ember.js, EmberCLI - removing the hash ( # ) from the URL

杀马特。学长 韩版系。学妹 提交于 2019-12-05 01:05:31
So according to Ember's documentation Ember defaults to using the hashchange event. Thats why we have the fancy #/some/url setup. We can also set it to use the browser's history API. I've noticed that most (if not all) sites listed on Built with Ember apparently use the history API. Which makes sense because it make the URL look more natural. All that is to say I (sorta) understand where, how, and why the # gets tacked on. My question relates specifically to EmberCLI. I've noticed that when I create a simple app the # is not in the URL. Is that because I havent deployed it yet? Or does the CLI

In Ember 1.13 and later what key should I use with each when iterating over an array of strings?

拜拜、爱过 提交于 2019-12-04 22:43:44
In Ember 1.13 the following code generates a warning: {{#each widgetNames as |widgetName|}} {{component widgetName removeWidget="removeWidget"}} {{/each}} Where widgetNames is an array of strings in a parent controller. widgetNames: [] In Ember 1.13 I now get this warning: WARNING: Using {{each}} without specifying a key can lead to unusual behavior. Please specify a key that identifies a unique value on each item being iterated. E.g. {{each model key="@guid" as |item|}} . This would be easy enough to fix in you typical model scenario, but how do I specify a key for an array of strings? Edit :

Disable / turn off LiveReload server in Emberjs / Ember-cli

↘锁芯ラ 提交于 2019-12-04 22:19:45
I use Cloud9 IDE, which only exposes port 80 and prevents LiveReload from connecting. I get this error: GET https://myapp.c9.io:35729/livereload.js?snipver=1 net::ERR_CONNECTION_REFUSED Unless someone knows of a fix, I'd like to simply turn this feature off / disable it. I'm running Ember-cli and I can see the task in ember-cli/lib/tasks/serve.js and I've commented it out, but it didn't do the trick: /* var liveReloadServer = new LiveReloadServer({ ui: this.ui, analytics: this.analytics, watcher: watcher }); */ It's buried in enough places that I'm afraid to npm remove it, as I think that

ember-cli adding dependencies with bower

╄→尐↘猪︶ㄣ 提交于 2019-12-04 20:27:21
问题 So - I want to have a play with typeahead in an ember app. I get a cli app up and running then I run bower install typeahead.js I can see that the code has been put into bower_components. I then add the following to the brocfile: /* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); var app = new EmberApp(); // Use `app.import` to add additional libraries to the generated // output files. // // If you need to use different assets in different // environments

How can I return a well formatted 201 with Express?

一个人想着一个人 提交于 2019-12-04 16:24:30
I'm trying to build todoMVC with ember-cli using the DS.RESTAdapter and express to mock out the calls. The issue I'm getting is that when I try to save a new todo I see this error in the console: SyntaxError: Unexpected end of input at Object.parse (native) at jQuery.parseJSON (http://localhost:4200/assets/vendor.js:8717:22) at ajaxConvert (http://localhost:4200/assets/vendor.js:9043:19) at done (http://localhost:4200/assets/vendor.js:9461:15) at XMLHttpRequest.jQuery.ajaxTransport.send.callback (http://localhost:4200/assets/vendor.js:9915:8) I'm pretty sure the issue is that when I call save(

Iframe in Chrome error: Failed to read 'localStorage' from 'Window': Access denied for this document

99封情书 提交于 2019-12-04 15:24:45
问题 I have a web app which uses localStorage. Now we want to embed this web app on other (third-party) sites via iframe. We want to provide an iframe embed similar to youtube so that other websites can embed our web app in an iframe. Functionally it is the same as if it wouldn't be embedded. But it does not work. Chrome prints the error message: Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. I just do the following check (in