ember-cli

How to pass API keys in environment variables to Ember CLI using process.env?

落花浮王杯 提交于 2020-01-09 12:50:14
问题 How do I pass environment variables from bashrc to Ember CLI. I imagine a situation where you need stripe api keys or pusher api-keys and you have them in your environment variables in bashrc. How do you pass the api-keys to Ember CLI. I tried using Node.js process.env in both the brocfile.js and environment.js , but when I try to access it in the Ember JS controller, the property is null. In my environment.js file I added, APP: { apiKey: process.env.KEY } In My Ember JS controller I tried

ember-cli typeahead causes errors inside ember.js

放肆的年华 提交于 2020-01-07 07:09:13
问题 installed type-ahead component from bower. and try to use {{type-ahead data=companies name="name" selection=selectedCompany}} component in action. it causes errors inside ember.js (_changeSingle and afterFunc functions) "Uncaught TypeError: Cannot read property 'selectedIndex' of undefined " Uncaught TypeError: Cannot read property 'nextSibling' of null is it for versions? 回答1: Here is my own typeahead ember component: Component App.XTypeaheadComponent = Ember.Component.extend({

When using Ember-cli-blanket for coverage data includes files from Ember itself instead of only files I created

旧城冷巷雨未停 提交于 2020-01-06 23:51:51
问题 I added ember-cli-blanket into my project and managed to get it working fine. localhost:4200/tests?coverage would show the coverage data. However it included files such as 'project/components/modal-dialog' or 'project/components/modal-dialog-overlay' in the results, which are not files in the project, but are included by Ember since the project uses a modal dialog in one of the template files. These extra test files don't give me anything new since I'm not testing the ember codebase and

Ember store query template no model data

别说谁变了你拦得住时间么 提交于 2020-01-06 20:25:15
问题 How come Ember model store query doesn't update template model data and find does? // This doesn't update the template, when loading website no information is displayed but the data is loaded model: function() { var parentModel = this.modelFor("server.view"); return this.store.query("server", { server_address: parentModel.server_address }); } // This works without any problems model: function() { var parentModel = this.modelFor("server.view"); return this.store.find("server", 1); } 回答1: So I

Include a raw js library in my ember cli project

天大地大妈咪最大 提交于 2020-01-06 19:48:15
问题 I would like to simply download this library and include it in my ember cli project. It is not available as a bower package, what should I do? https://github.com/appendto/jquery-mockjax.git thanks 回答1: Something like this should do: bower install --save appendto/jquery-mockjax You may notice this uses github-user/repository-name Brocfile.js: app.import( 'bower_components/jquery-mockjax/jquery.mockjax.js' ); 来源: https://stackoverflow.com/questions/25665864/include-a-raw-js-library-in-my-ember

Simulate a ember-select2 selection in ember integration test

喜夏-厌秋 提交于 2020-01-05 08:32:25
问题 Has anyone been able to simulate a select2 selection of an option? So far I've tried this: test("Checking navigation", function () { expect(1); visit("/hub"); click("#btnLogin"); andThen(function () { click(".select2-container"); andThen(function () { }); }); }); But I have not seen changes in the UI. 回答1: We need to hit the anchor inside the container Ember.$(" .select2-container a").trigger({type:'mousedown', which:1}); If you want to select an item in the dropdown you can do: Ember.$("

Emberjs - how to properly modify records on a model that has been set as a property in the controller?

非 Y 不嫁゛ 提交于 2020-01-05 07:49:50
问题 My template: {{#each test11}} {{businessname}} {{/each}} My controller that works: // businessmatches is a model that is set as a controller property in the router test11: function () { var raw = this.get('businessmatches'); // I want to be able to get all the records, filter them etc etc and then // make them available to the template return [ Ember.Object.create(raw.content.get(0)._data) ]; }.property('businessmatches'), raw.content.get(0)._data feels like a hack, so I must be missing the

Invalid Version: Ember-Cli-Babel

我只是一个虾纸丫 提交于 2020-01-05 07:17:12
问题 Tried upgrading my ember project from ember 2.12.2 to 2.13.2 but I get the following error when I run ember init Invalid Version: https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-6.1.0.tgz TypeError: Invalid Version: https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-6.1.0.tgz at new SemVer (/Users/code/website/node_modules/semver/semver.js:293:11) at Range.test (/Users/code/website/node_modules/semver/semver.js:1036:15) at Function.satisfies (/Users/code/website/node

How to programatically add component via controller action in ember 2.x

╄→гoц情女王★ 提交于 2020-01-05 00:03:49
问题 I am being faced with the same problem on How to programatically add component via controller action However since I am using ember cli, I am unable to do so. Here is my source code import Ember from "ember"; export default Ember.Component.extend({ actions : { remove : function(){ this.remove(); }, add : function() { Ember.AuthorNameComponent.create().appendTo($('#authors')); } }, }); When I try to run this code, I get undefined error. Also name of component is author-name. Any help, how can

How to programatically add component via controller action in ember 2.x

主宰稳场 提交于 2020-01-05 00:02:37
问题 I am being faced with the same problem on How to programatically add component via controller action However since I am using ember cli, I am unable to do so. Here is my source code import Ember from "ember"; export default Ember.Component.extend({ actions : { remove : function(){ this.remove(); }, add : function() { Ember.AuthorNameComponent.create().appendTo($('#authors')); } }, }); When I try to run this code, I get undefined error. Also name of component is author-name. Any help, how can