ember-cli

No command 'ember' found

房东的猫 提交于 2019-12-06 06:43:44
问题 Seems like I messed up with my ember-cli install. I had installed the npm using sudo, but after reading some issues with ember-cli and sudo on npm I went for uninstall and reinstall following the instruction here https://gist.github.com/isaacs/579814. Now I have installed ember-cli through npm install -g ember-cli but when I do an ember new <name> I get No command 'ember' found, did you mean: Command 'enber' from package 'asn1c' (universe) ember: command not found I can do which node $ which

Ember-cli: importing blanket.js causes test runners to hang

左心房为你撑大大i 提交于 2019-12-06 03:07:47
I'm currently using ember-cli with ember-qUnit for testing. I would also like to add code coverage results to the test output, so after some research blanketjs seemed the way to go. I installed blanket using: npm install blanket And moved the blanket folder into the ember-cli vendor folder. As I understand the way to import libraries is through the Brocfile.js which I am doing like so: app.import('vendor/blanket/dist/qunit/blanket.js'); Using ember inspector it appears that blanket has been imported correctly, and the "enable coverage" checkbox has appeared at the top of the qUnit test results

Using CDN with ember-cli

不打扰是莪最后的温柔 提交于 2019-12-06 02:44:46
问题 In my app, developed using ember-cli, I need also some external resources like bootstrap; now I'm importing it through the Brocfile: app.import('bower_components/bootstrap/dist/css/bootstrap.css'); app.import('bower_components/bootstrap/dist/js/bootstrap.js'); Is it possible to use a CDN instead of local file, defining also a callback to local file in case the CDN is offline? 回答1: Ember-cli-cdn sounds like a partial solution to the problem to me. Here is a quote from the Readme: This addon

Use Forever with Ember-CLI

人盡茶涼 提交于 2019-12-06 02:38:08
问题 I've set up a website using Ember-CLI and it is now ready for production, so we're looking for a way to keep it running permanently. Right now we're using $ ember serve --port 80 but obviously this only works whilst we're logged in. I've used Forever before to keep a node app running but am not sure how to make this work with Ember CLI, as the 'ember serve' command obviously does more than just running app.js? Any input would be appreciated! 回答1: Ember-CLI apps are NOT node apps, they are

Ember-CLI on Apache TOMCAT

倾然丶 夕夏残阳落幕 提交于 2019-12-05 23:16:15
I am trying to load my ember-cli inbuilt server application on Apache tomcat. I built my application in production mode using ember build --environment production I moved the files in my /dist folder to my apache tomcat /webapps folder started my apache server but when i go to the URL: "localhost:8081/index.html" The page is blank although the it works perfect with the inbuilt server. Using Ember inspector i can see the routes that are defined but not able to view any output. I followed this guide http://thetechcofounder.com/getting-started-with-ember-js-using-ember-cli/# = to create my ember

how to trigger element features after render in ember-cli

半城伤御伤魂 提交于 2019-12-05 19:26:14
I want to add tooltips onto a button in a component that can appear based on a set of results back from the server. (i.e. action buttons for delete, edit etc.) I have created a “search” component that is rendering into the application and when a search button is clicked the server may return a number of rows into that same search component template. so for example: My-app/pods/factual-data/template.hbs Contains: … {{#if results}} <div class="row"> <div class="col-sm-3"><b>Factual ID</b></div> <div class="col-sm-2"><b>Name</b></div> <div class="col-sm-2"><b>Town</b></div> <div class="col-sm-2">

Environment-based host in Ember CLI app

断了今生、忘了曾经 提交于 2019-12-05 16:49:10
问题 I'm trying to configure the adapter in my Ember CLI app to use a different host based on the environment. In dev, I want it to be the default current host (letting me customize it via the --proxy option, but in production I know it will be http://some.url . I tried importing my ENV into my application adapter: // adapters/application.js import DS from "ember-data"; import ENV from "../../config/environment"; export default DS.ActiveModelAdapter.extend({ host: ENV.host }); but I'm getting an

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

◇◆丶佛笑我妖孽 提交于 2019-12-05 12:39:41
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? The syntax has been updated to: bower install ember#2.0.0 --save-dev --save-exact @Sukima's answer will work fine, but you can also use the ember-cli command: ember install:bower ember#<version> In your case, upgrading to Ember 1.11.0 would look like this: ember install:bower ember#1.11.0 Source: http://www.ember-cli

How to use md5.js within a compontent?

邮差的信 提交于 2019-12-05 12:36:06
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.gravatar.com/avatar/' + md5(email) + '?s=' + size; }.property('email', 'size') }); After starting

Access constant in an Ember template

此生再无相见时 提交于 2019-12-05 10:46:31
Not sure what the proper "Ember Way" is to do this. I have the following template, where I want to have three task-item-list component instances, each for a different taskState value. Obviously, I would like to get rid of the magic numbers. <h4>Tasks:</h4> <div><h5>Backlog:</h5> {{ task-item-list tasks=model taskState=101 }} </div> <div><h5>Working:</h5> {{ task-item-list tasks=model taskState=202 }} </div> <div><h5>Done!</h5> {{ task-item-list tasks=model taskState=303 }} </div> Thanks to this discussion I can define constants in my config/environment.js file and use them in models, test, etc